tags:

views:

52

answers:

2

When I tried to install a software on RedHat EL5, I got the error that the expected value of soft/hard nofile is 4096 while the default is 1024. I managed to increase the number, but I don't know what the parameters are. Are they refering to soft link and hard link?

The way I change it is: A) modify the /etc/security/limits.conf

user soft nofile 5000

user hard nofile 6000

B) modify the /etc/pam.d/system-auth

session required /lib/security/$ISA/pam_limits.so

C) modify /etc/pam.d/login

session required pam_limits.so

After making the change (by switching to root). It seems that I have to reboot machine to make it effect. But some post online say that it should come to effect right after making the change. Would appreciate if someone can clarify it.

+5  A: 

These are: a 'soft' and a 'hard' limit for number of files a process may have opened at a time. Both limit the same resource (no relation to hard links or anything). The difference is: the soft limit may be changed later, up to the hard limit value, by the process running with these limits and hard limit can only be lowered – the process cannot assign itself more resources by increasing the hard limit (except processes running with superuser privileges (as root)).

Similar limits can be set for other system resources: system memory, CPU time, etc. See the setrlimit(2) manual page or the description of your shell's ulimit build-in command (e.g. in the bash(1) manual page.

Jacek Konieczny
One minor exception is that processes running as `root` may increase their hard limit as well as their soft limit.
R Samuel Klatchko
Thanks for reminding that. I have updated my answer.
Jacek Konieczny
+1  A: 

No reboot is required, but /etc/security/limits.conf is only processed when /lib/security/pam_limits.so runs, which is at login time, and the values are inherited by child processes. After a new login, anything under that login will inherit the values specified.

Chris
Thanks for the clarification