--- supervisor-3.0a8/debian/supervisor.init 2013-11-09 20:28:04.000000000 +0800 +++ supervisor-3.0b2/debian/supervisor.init 2013-07-29 19:04:45.000000000 +0800 @@ -21,6 +21,7 @@ # subprocesses. ### END INIT INFO +. /lib/lsb/init-functions PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/bin/supervisord @@ -40,6 +41,7 @@ if [ -f /etc/default/supervisor ] ; then . /etc/default/supervisor fi +DAEMON_OPTS="-c /etc/supervisor/supervisord.conf $DAEMON_OPTS" set -e @@ -91,7 +93,7 @@ start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile $PIDFILE \ - --exec $DAEMON -- $DAEMON_OPTS + --startas $DAEMON -- $DAEMON_OPTS test -f $PIDFILE || sleep 1 if running ; then echo "$NAME." @@ -132,18 +134,17 @@ # just the same as "restart" except that it does nothing if the # daemon isn't already running. # check wether $DAEMON is running. If so, restart - start-stop-daemon --stop --test --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON \ + start-stop-daemon --stop --test --quiet --pidfile $PIDFILE \ + --startas $DAEMON \ && $0 restart \ || exit 0 ;; restart) echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON + start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE [ -n "$DODTIME" ] && sleep $DODTIME - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --startas $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; status)