From ea21e3c9f067f4100ae08edddf53642a5c9a04bb Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 29 Mar 2017 14:01:26 +0100 Subject: update startup script --- hangdaiapp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'hangdaiapp') diff --git a/hangdaiapp b/hangdaiapp index 6690c82..b1ad1c1 100644 --- a/hangdaiapp +++ b/hangdaiapp @@ -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 -- cgit v1.2.3