Package: dh-make
Version: 0.41
Severity: wishlist
Tags: patch
The attached patch fixed force-reload in the init.d sample file to
behave like LSB demands it to work: restart the service only if it is
already running.
The template should also contain the LSB dependency info (and other)
headers, but I'm currently too tired to also provide a patch for that.
-- System Information:
Debian Release: 3.1
APT prefers stable
APT policy: (990, 'stable'), (400, 'experimental'), (90, 'testing'), (50,
'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11.12-incase
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
--- lib/debian/init.d.ex.orig 2006-07-08 01:21:08.375943002 +0200
+++ lib/debian/init.d.ex 2006-07-08 01:26:26.036345210 +0200
@@ -49,12 +49,20 @@
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
- restart|force-reload)
+ force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
- # just the same as "restart".
+ # just the same as "restart" except that it does nothing if the
+ # daemon isn't already running.
#
+ # check wether $DAEMON is running. If so, restart
+ start-stop-daemon --stop --test --quiet --pidfile \
+ /var/run/$NAME.pid --exec $DAEMON \
+ && $0 restart \
+ || exit 0
+ ;;
+ restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON