diff --git a/debian/init.d b/debian/init.d index 6767a8d..4feeaee 100644 --- a/debian/init.d +++ b/debian/init.d @@ -35,23 +35,22 @@ case "$1" in echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS + ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON - killall -9 $NAME echo "$NAME." ;; restart|force-reload) echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON - killall -9 $NAME - sleep 1 - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS + start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON + start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON -- $DAEMON_OPTS + ps aux | grep $DAEMON | head -1 | awk '{ print $2 }' > /var/run/$NAME.pid echo "$NAME." ;; *)