0

On my centos 5.5 server,i set in limits.conf with bellow:

* soft nofile 409600
* hard nofile 409600

but when i issue command:ulimit -n. It tell me :

open files                      (-n) 1024

I had set fs.file-max=1188373 in /etc/sysctl.conf. I don't know where is wrong.Please help me! Thanks!

1
  • So about cat /proc/sys/fs/file-max ?
    – cuonglm
    May 16, 2013 at 10:05

2 Answers 2

0

Is there maybe some rule inside /etc/security/limits.d/ overriding your settings?

5
  • Do you try sysctl -p. Give the result of command ulimit -Hn and ulimit -Sn
    – cuonglm
    May 16, 2013 at 9:51
  • It is empty in /etc/security/limits.d.@Pascal Schmiel
    – lyxing
    May 16, 2013 at 9:54
  • have you re-logged in after you've set the new limits? May 16, 2013 at 9:57
  • @Gnouc .sysctl -a|grep file :fs.file-max = 1188373 .ulimit -HSn :1024
    – lyxing
    May 16, 2013 at 9:57
  • The limits were set long long ago.I checked the mistake today. @Pascal Schmiel
    – lyxing
    May 16, 2013 at 10:00
0

In case it is not just a mistake in the question, I'd suggest to put just fs.file-max=1188373 in /etc/sysctl.conf instead of prefixing this with set.

Then load it with sysctl -p /etc/sysctl.conf and check, as was already suggested, with cat /proc/sys/fs/file-max if it had any effect.

3
  • sysctl -a|grep file :fs.file-max = 1188373 . cat /proc/sys/fs/file-max 1188373 @Stefan Eggers
    – lyxing
    May 16, 2013 at 10:37
  • cat /proc/sys/fs/file-max 1188373
    – lyxing
    May 16, 2013 at 10:39
  • OK, so that is working. Does /etc/pam.d/system-auth (probably a symlink to system-auth-ac) contain a line with pam_limits.so in it? May 16, 2013 at 19:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .