diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-03-08 23:28:19 +0000 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-03-08 23:28:19 +0000 |
commit | 122e57e736087d16c4093865d938a8d08c099658 (patch) | |
tree | 3795b8b2b85ce36a591e1320adb2c048336ccad6 /debian/init.d | |
parent | a3187b873079d0c2c14f0bbf0180d8883805d58f (diff) | |
download | lcd4linux-122e57e736087d16c4093865d938a8d08c099658.tar.gz |
* Rewrite init script to use lsb-base functions.
- init.d-script-does-not-implement-optional-option
Diffstat (limited to '')
-rw-r--r-- | debian/init.d | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/debian/init.d b/debian/init.d index d9c29f7..2b8e364 100644 --- a/debian/init.d +++ b/debian/init.d @@ -19,6 +19,8 @@ DAEMON=/usr/sbin/lcd4linux NAME=lcd4linux DESC=lcd4linux +. /lib/lsb/init-functions + test -x $DAEMON || exit 0 test -f /etc/lcd4linux.conf || exit 0 @@ -29,31 +31,27 @@ set -e case "$1" in start) - echo -n "Starting $DESC: " + log_daemon_msg "Starting $DESC" "$NAME" chmod 600 /etc/lcd4linux.conf start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." + log_end_msg 0 ;; stop) - echo -n "Stopping $DESC: " + log_daemon_msg "Stopping $DESC" "$NAME" start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ - --exec $DAEMON || true - echo "$NAME." + --exec $DAEMON + log_end_msg 0 ;; restart|force-reload) - echo -n "Restarting $DESC: " - start-stop-daemon --stop --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON - sleep 1 - start-stop-daemon --start --quiet --pidfile \ - /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS - echo "$NAME." + $0 stop && sleep 2 && $0 start + ;; + status) + status_of_proc $DAEMON "$NAME" ;; *) N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|status|force-reload}" >&2 exit 1 ;; esac |