tor: Increase number of max. open file descriptors.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / tor
index d631e867f915e123e918383b3c9caa86af1e5a71..878080eff3bbe4c220cbfa2fba85f16494a0f2a9 100644 (file)
@@ -9,6 +9,8 @@
 . /etc/sysconfig/rc
 . ${rc_functions}
 
+FILEDESCRIPTORS="65535"
+
 eval $(/usr/local/bin/readhash /var/ipfire/tor/settings)
 
 function tor_is_enabled() {
@@ -36,6 +38,11 @@ case "${1}" in
                # Setup firewall.
                setup_firewall
 
+               # Increasing open file descriptors.
+               if [ -n "${FILEDESCRIPTORS}" ]; then
+                       ulimit -n "${FILEDESCRIPTORS}"
+               fi
+
                boot_mesg "Starting tor..."
                loadproc /usr/bin/tor \
                        --runasdaemon 1 \