Package: specter
Version: 1.4-3
Severity: normal
Tags: patch

Init script returns a non zero status when called to stop / start an
already stopped / started specter daemon.
This has unexcepted behaviour when trying to restart specter or to
uninstall it when daemon is already stopped.

An example output when trying to remove the package and specter daemon
is already stopped:

The following packages will be REMOVED:
  specter*
0 upgraded, 0 newly installed, 1 to remove and 42 not upgraded.
After this operation, 401kB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 141013 files and directories currently installed.)
Removing specter ...
Stopping Specter Logging Facility: invoke-rc.d: initscript specter,
action "stop" failed.
dpkg: error processing specter (--purge):
 subprocess pre-removal script returned error exit status 1
Starting Specter Logging Facility: Specter.
Errors were encountered while processing:
 specter
E: Sub-process /usr/bin/dpkg returned an error code (1)


A possible patch could be:

--- specter.orig        2009-05-14 17:21:28.000000000 +0200
+++ specter     2009-05-14 17:26:54.000000000 +0200
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh -e
 ### BEGIN INIT INFO
 # Provides:          specter
 # Required-Start:    $remote_fs $syslog
@@ -25,13 +25,23 @@
 case "$1" in
   start)
        echo -n "Starting $DESC: "
-       start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
-       echo "$NAME."
+       if start-stop-daemon --stop --quiet --signal 0 --exec $DAEMON
+       then
+               echo "[already running]"
+       else
+               start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
+               echo "$NAME."
+       fi
        ;;
   stop)
        echo -n "Stopping $DESC: "
-       start-stop-daemon --stop --quiet --exec $DAEMON
-       echo "$NAME."
+       if start-stop-daemon --stop --quiet --signal 0 --exec $DAEMON
+       then
+               start-stop-daemon --stop --quiet --exec $DAEMON
+               echo "$NAME."
+       else
+               echo "[not running]"
+       fi
        ;;
   reload)
         echo "Reloading $DESC configuration files."
@@ -39,15 +49,17 @@
   ;;
   restart|force-reload)
        echo -n "Restarting $DESC: "
-       start-stop-daemon --stop --quiet --exec $DAEMON
-       sleep 1
+       if start-stop-daemon --stop --quiet --signal 0 --exec $DAEMON
+       then
+               start-stop-daemon --stop --quiet --exec $DAEMON
+               sleep 1
+       fi
        start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_OPTS
        echo "$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
        exit 1
        ;;
 esac


-- System Information:
Debian Release: 5.0
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages specter depends on:
ii  adduser                       3.110      add and remove users and groups
ii  iptables                      1.4.2-6    administration tools for packet fi
ii  libc6                         2.9-4      GNU C Library: Shared libraries

specter recommends no packages.

Versions of packages specter suggests:
pn  specter-mysql                 <none>     (no description available)
pn  specter-pgsql                 <none>     (no description available)

-- no debconf information

Attachment: signature.asc
Description: Digital signature

Reply via email to