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