update scripts

This commit is contained in:
Max Lv
2014-03-28 17:07:21 +08:00
parent 2ad32adcb6
commit d14da247dc
6 changed files with 11 additions and 37 deletions
+3
View File
@@ -18,3 +18,6 @@ DAEMON_ARGS=""
# User and group to run the server as
USER=root
GROUP=root
# Number of maximum file descriptors
MAXFD=1024
+4 -1
View File
@@ -45,6 +45,9 @@ SCRIPTNAME=/etc/init.d/$NAME
#
do_start()
{
# Modify the file descriptor limit
ulimit -n ${MAXFD}
# Take care of pidfile permissions
mkdir /var/run/$NAME 2>/dev/null || true
chown "$USER:$GROUP" /var/run/$NAME
@@ -56,7 +59,7 @@ do_start()
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON -- \
-c "$CONFFILE" -a "$USER" -u -f $PIDFILE $DAEMON_ARGS \
-c "$CONFFILE" -u -f $PIDFILE $DAEMON_ARGS \
|| return 2
}