From: Brian West Date: Mon, 15 Nov 2010 17:12:50 +0000 (-0600) Subject: FS-2844: Patch debian init.d script to set ulimit values X-Git-Tag: v1.2-rc1~265^2~11^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0eb33e57617079f0d3d9a8891f99439d45ffd29a;p=thirdparty%2Ffreeswitch.git FS-2844: Patch debian init.d script to set ulimit values --- diff --git a/debian/freeswitch.init b/debian/freeswitch.init index 1eb71ac6d6..ddde2f5518 100755 --- a/debian/freeswitch.init +++ b/debian/freeswitch.init @@ -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