diff options
Diffstat (limited to 'debian/init.d')
-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 |