summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortim <tim@eclectronics.org>2017-03-29 14:01:26 +0100
committertim <tim@eclectronics.org>2017-03-29 14:01:26 +0100
commitea21e3c9f067f4100ae08edddf53642a5c9a04bb (patch)
tree619d47efb47cac5ae4cb80f5305419f24ae13c05
parent4eff602f4988b0e9fa659dc84d86a70e90c2be7f (diff)
update startup script
-rw-r--r--hangdaiapp18
1 files changed, 11 insertions, 7 deletions
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