[tor-relays] rpm init script not setting ulimit properly

Aaron Hopkins 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
great plan.

I'm using the stock /etc/init.d/tor startup script that came in the
tor- RPM offered by the YUM repo
http://deb.torproject.org/torproject.org/rpm/centos5-experimental.  It
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?

                                     -- Aaron

More information about the tor-relays mailing list