aboutsummaryrefslogtreecommitdiff
path: root/debian/tor.init
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-07-07 11:27:59 +0000
committerPeter Palfrader <peter@palfrader.org>2008-07-07 11:27:59 +0000
commit57de86bae723e164022f3c984b47a0d4dac068cf (patch)
tree6228e9a91a4b399ee1ab9bd6ee4aa407d27da910 /debian/tor.init
parent272165e659f113a9a78d05baff61a41dd9b60f33 (diff)
downloadtor-57de86bae723e164022f3c984b47a0d4dac068cf.tar
tor-57de86bae723e164022f3c984b47a0d4dac068cf.tar.gz
merge from 0.2.0.x: r15718: Warn the admin if the number of file descriptors on his system is tiny
svn:r15719
Diffstat (limited to 'debian/tor.init')
-rw-r--r--debian/tor.init24
1 files changed, 18 insertions, 6 deletions
diff --git a/debian/tor.init b/debian/tor.init
index ea71e94bb..aa8fa37fd 100644
--- a/debian/tor.init
+++ b/debian/tor.init
@@ -28,14 +28,26 @@ ARGS=""
# Let's try to figure our some sane defaults:
if [ -r /proc/sys/fs/file-max ]; then
system_max=`cat /proc/sys/fs/file-max`
- if [ "$system_max" -gt "80000" ] ; then
- MAX_FILEDESCRIPTORS=32768
- elif [ "$system_max" -gt "40000" ] ; then
- MAX_FILEDESCRIPTORS=16384
- elif [ "$system_max" -gt "10000" ] ; then
- MAX_FILEDESCRIPTORS=8192
+ #if [ "$system_max" -gt "80000" ] ; then
+ #MAX_FILEDESCRIPTORS=32768
+ #elif [ "$system_max" -gt "40000" ] ; then
+ #MAX_FILEDESCRIPTORS=16384
+ #elif [ "$system_max" -gt "10000" ] ; then
+ #MAX_FILEDESCRIPTORS=8192
+ if 0; then
+ echo fo
else
MAX_FILEDESCRIPTORS=1024
+ cat << EOF
+
+Warning: Your system has very few filedescriptors available in total.
+
+Maybe you should try raising that by adding 'fs.file-max=100000' to your
+/etc/sysctl.conf file. Feel free to pick any number that you deem appropriate.
+Then run 'sysctl -p'. See /proc/sys/fs/file-max for the current value, and
+file-nr in the same directory for how many of those are used at the moment.
+
+EOF
fi
else
MAX_FILEDESCRIPTORS=8192