Increasing nproc for processes launched by systemd on CentOS 7
systemd completely ignores /etc/security/limits*. If you are using an RPM that auto-squashes its systemd service file on update, you'll want to file a PR to ask them to mark those files as 'noreplace'
You need to update the .service file
[Unit] Description=Some Daemon After=syslog.target network.target [Service] Type=notify LimitNOFILE=49152 ExecStart=/usr/sbin/somedaemon [Install] WantedBy=multi-user.target
sickill pointed out that you can also override the package-installed values (found in the above file) by adding them to
This provides the added bonus of system-specific settings that aren't in danger of being overwritten on package update.
Then issue the command:
Configuration files in
/usr/lib/systemd/system/ should not be edited by hand and it is perfectly normal (if not expected) that an rpm will update files that it manages in this directory on update.
As @sickill and @Cherif KAOUA pointed out in comments [https://stackoverflow.com/questions/27849331/how-to-set-nginx-max-open-files/36423859#36423859] you should add custom configuration including limits into
Then reload the systemctl daemon config:
RHEL has a great section on systemd in their System Administrator Guide which among other things, lists where systemd unit files should be located and how to override defaults.