Linux – Can we set ulimit in /etc/sysconfig/init file to apply the value at boot time

bootlinuxredhatulimit

I need to have the ulimit value set at the boot time to all my services. I have values set in /etc/sysconfig/limits.conf but these values are not applicable during the boot time and it takes 1024 as default.

I have set the values in limits.conf, also checked whether /etc/pam.d/* contains "required pam_limits.so" entries and even /etc/security/limits.d/90-nproc.conf doesn't have default entries.

Now I found another way to include the value during the boot time, I came across /etc/sysconfig/init file. When I set the value in this file, all the services got the expected value during the boot time.

Now, I am unsure about the impact on the server and what things should be ignore configuring in this /etc/sysconfig/init file. Also is there any alternative other then this file or methods mentioned above.

Best Answer

The ulimits aren't specific to services or system-wide, they are specific to individual accounts. The soft limit in /etc/security/limits.conf should be what appears as the default when you start the service; this doesn't seem to be happening in your case, so I would start looking at the dot-files for the user(s) running the service(s) in question or at the actual init script for the service(s) in question. I have a feeling your ulimit is set in one of those two places, and thus overriding the /etc/security/limits.conf values.