Post by Clark Smith
I am aware of the approach consisting of entering the appropriate
commands in /etc/initscript, which, when executed at boot time, will
increase the number accordingly. For example, if my /etc/initscript file
ulimit -Hn 32768 PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH
# Execute the program.
eval exec "$4"
then on rebooting the hard limit for file descriptors per user will be
32768 - assuming that the system allows that many overall, which 14.2
most certainly does.
Is it possible to do this, but without having to reboot?
Your problem is that the file /etc/initscript only affects the init
process (pid 1) and processes later spawned from init.
The processes that you start are not started from init, they might be
started from a shell or a window manager, both existing processes and the
child process will inherit its parents limits.
So to get init to give all processes new limits by sendeing these new
limits to new childs will require a reboot.
However, it is possible to also alter the limits of running processes. If
you do that to your window manager and/or some shell processes you might
be able to accomplish what you want. The syntax is:
prlimit --nofile=4096:8192 --pid 13921