]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-2844: Patch debian init.d script to set ulimit values
authorBrian West <brian@freeswitch.org>
Mon, 15 Nov 2010 17:12:50 +0000 (11:12 -0600)
committerBrian West <brian@freeswitch.org>
Mon, 15 Nov 2010 17:13:04 +0000 (11:13 -0600)
debian/freeswitch.init

index 1eb71ac6d6aef7fc8f14d1050b195010b3ac41e3..ddde2f5518ca0e3601342897c9503d49e435d810 100755 (executable)
@@ -48,6 +48,24 @@ fi
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
 
+#
+# Function that sets ulimit values for the daemon
+#
+do_setlimits() {
+        ulimit -c unlimited
+        ulimit -d unlimited
+        ulimit -f unlimited
+        ulimit -i unlimited
+        ulimit -n 999999
+        ulimit -q unlimited
+        ulimit -u unlimited
+        ulimit -v unlimited
+        ulimit -x unlimited
+        ulimit -s 240
+        ulimit -l unlimited
+        return 0
+}
+
 #
 # Function that starts the daemon/service
 #
@@ -59,6 +77,7 @@ do_start()
        #   2 if daemon could not be started
        start-stop-daemon -d $WORKDIR -c $USER --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                || return 1
+       do_setlimits
        start-stop-daemon -d $WORKDIR -c $USER --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $FREESWITCH_PARAMS \
                || return 2