update debian init script

run as root firstly, then switch to $USER by "-a" parameter, so that we can bind to port lower than 1024 when running as normal user.
This commit is contained in:
draplater
2015-01-30 21:47:17 +08:00
parent fb856bd43c
commit a9613596c9
+2 -2
View File
@@ -56,9 +56,9 @@ do_start()
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid root:$GROUP --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON -- \
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid root:$GROUP --exec $DAEMON -- \
-c "$CONFFILE" -a "$USER" -u -f $PIDFILE $DAEMON_ARGS \
|| return 2
}