[tor-relays] rpm init script not setting ulimit properly
lists at die.net
Wed Jun 6 17:24:13 UTC 2012
I noticed my exit node (tordienet) hovering around 1024 connections open,
and checked /proc/<pid>/limits (available on newer kernels) and noticed that
the filedescriptor ulimit was at the default 1024, which is likely not a
I'm using the stock /etc/init.d/tor startup script that came in the
tor-0.2.3.12.alpha-tor.0.rh5_7 RPM offered by the YUM repo
attempts to set ulimit, but at least at startup on my Centos 5.8 openvz
container, there's a soft limit set at 1024 filedescriptors, which requires
the -S flag to ulimit to override.
I changed line 87 of /etc/init.d/tor to:
if ulimit -SHn "$MAX_FILEDESCRIPTORS" ; then
And /proc/<pid>/limits shows tor running with the appropriate limits now.
Unfortunately, this is likely to get reverted with the next package update.
Is anyone else using the stock RPMs seeing the same behavior?
More information about the tor-relays