I realize this thread is 14 years old, but it was useful to me today! I have something to add:
My server is powered by TCL. I run
galene videoconference server on it (
https://galene.org/galene-install.html), among many other things. Galene needs a high file descriptor limit in order to work well.
qopit's advice here works:
tc@box:~$ sudo su
root@box:~# ulimit -Hn 65536
root@box:~# ulimit -Sn 65536
root@box:~# su tc
tc@box:~$ ulimit -Sn
65536
tc@box:~$ galene &
But I found the method above to be impossible to put in a shell script (a script that, for example, restarts the galene server after my ssl certificate has been renewed). The fact that
ulimit is a shell builtin really complicates things.
The solution for me was to use
prlimit (provided by util-linux.tcz), which is just a regular executable at /usr/local/bin/prlimit.
Here is the script I run to restart
galene after my ssl certificate has changed due to renewal. I called it
videoconference-restart.sh:
#!/bin/sh
pkill galene
galene &
galene_pid=$!
sudo prlimit --pid=$galene_pid --nofile=65536
Other users with special need for high file descriptor limit, who are struggling with
ulimit, may also find
prlimit to be useful.