FS-2844: Patch debian init.d script to set ulimit values

This commit is contained in:
Brian West 2010-11-15 11:12:50 -06:00
parent a09bce346e
commit 0eb33e5761
1 changed files with 19 additions and 0 deletions

View File

@ -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