From 122e57e736087d16c4093865d938a8d08c099658 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Thu, 8 Mar 2012 23:28:19 +0000 Subject: * Rewrite init script to use lsb-base functions. - init.d-script-does-not-implement-optional-option --- debian/changelog | 4 +++- debian/control | 1 + debian/init.d | 26 ++++++++++++-------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 63ea583..04a9a7b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,11 +5,13 @@ lcd4linux (0.11.0~svn1180-1) unstable; urgency=low - adds new TeakLCM driver - adds new Futaba VFD driver - adds new Samsung SPF driver + * Rewrite init script to use lsb-base functions. * Lintian fixes - spelling-error-in-manpage - copyright-refers-to-symlink-license + - init.d-script-does-not-implement-optional-option - -- Jonathan McCrohan Thu, 08 Mar 2012 21:32:34 +0000 + -- Jonathan McCrohan Thu, 08 Mar 2012 23:21:40 +0000 lcd4linux (0.11.0~svn1165-1) unstable; urgency=low diff --git a/debian/control b/debian/control index d861ba7..d379e94 100644 --- a/debian/control +++ b/debian/control @@ -23,6 +23,7 @@ Homepage: http://ssl.bulix.org/projects/lcd4linux/ Package: lcd4linux Architecture: linux-any Depends: + lsb-base, ${misc:Depends}, ${shlibs:Depends} Description: Grabs information and displays it on an external lcd 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 -- cgit v1.2.3