How to enable nofile during boot

Robert Freiberger <[email protected]>
Newsgroups gmane.org.user-groups.linux.svlug
Message-ID <CAK5y5r6oxNujpzatW8Z8ChfnYoxGzzu0k=+h0=3Bineor5N6vg@mail.gmail.com>
Hello,

I'm stuck on a work task and for the life of me, don't understand why my
settings are not taking hold of the system.

The requirements is changing the setting for the process to use "max open
files 871114". The host is RHEL6.

For example, I'm running Apache on this host with the parent as PID 31482.

$ sudo cat /proc/31482/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            10485760             unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             7903                 7903
processes
*Max open files            871114               871114               files*
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       7903                 7903                 signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

This was set by adding the following.

$ cat /etc/sysctl.conf | grep fs.file-max
fs.file-max = 871114

$ cat /etc/security/limits.conf
* soft nofile 871114
* hard nofile 871114

So when I restart the host, I can find these settings are showing up.

$ cat /proc/sys/fs/file-max
871114

The issue is when I restart the host ($ sudo shutdown -r now) the settings
for the processes are not following the setting of max files 871114, and
defaulting to a lower number. If I restart the process, then it shows
871114.

Any ideas what I'm doing wrong? I'm going to check more about this over the
week but it's been a while since I really dug into init and the different
system details.

Thanks,
Robert
-- 
Robert Freiberger
510-936-1210

_______________________________________________
svlug mailing list
[email protected]
http://lists.svlug.org/lists/listinfo/svlug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.