diff options
| -rw-r--r-- | hangdaiapp | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -1,13 +1,16 @@ #!/bin/sh ### BEGIN INIT INFO -# Provides: exampledaemon -# Required-Start: $local_fs $network $syslog -# Required-Stop: $local_fs $network $syslog +# Provides: hangdai +# Required-Start: $all +# Required-Stop: $all +# X-Start-Before: nis +# X-Stop-After: nis # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Example -# Description: Example start-stop-daemon - Debian +# X-Interactive: false +# Short-Description: hangdai +# Description: hangdai start-stop-daemon - Debian ### END INIT INFO NAME="hangdai" @@ -18,7 +21,7 @@ APPARGS="" USER="tim" GROUP="tim" -DISPLAY=:0 + # Include functions set -e @@ -26,7 +29,7 @@ set -e start() { printf "Starting '$NAME'... " - start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --chdir "$APPDIR" --exec "$APPBIN" -- $APPARGS || true + start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile /var/run/$NAME.pid --chdir "$APPDIR" --exec 1> >(logger -s -t $(basename $0)) 2>&1 /usr/bin/env DISPLAY=:0 "$APPBIN" -- $APPARGS || true printf "done\n" } @@ -42,6 +45,7 @@ killtree() { stop() { printf "Stopping '$NAME'... " + [ -z `cat /var/run/$NAME.pid 2>/dev/null` ] || \ while test -d /proc/$(cat /var/run/$NAME.pid); do killtree $(cat /var/run/$NAME.pid) 15 |
