Limit of open files for the init (pid 1) process and its children?

RafaƂ Radecki radecki.rafal at gmail.com
Fri Apr 8 11:26:55 UTC 2016


Hi all ;)

My situation is:
- init process starts during boot
- services from /etc/init/*.conf are started by init and inherit its
"ulimit" settings (number of open files, etc...)
- at the end some process is spawned by exec and has the same "ulimit" as
the init (pid 1) process
I see that:

# cat /proc/1/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            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             120197               120197
processes
Max open files            1024                 4096                 files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       120197               120197               signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

and I would like to set a different value for "Max open files" for init
(pid 1) process so that all child processes (I need it for scripts from
/etc/init/*.conf files) will inherit it. Is there a way to change this for
init itself?

I know that I can use ulimit command in start scripts of the children
processes, and I can use /etc/security/limit.conf after properly
configuring pam. But at the moment I need this functionality for processes
spawned directly by init from /etc/init/*.conf. Can this be done?

BR,
Rafal.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20160408/fca9811c/attachment.html>


More information about the ubuntu-users mailing list