In killproc(), re-add a '--retry 5' to s-s-d when no signal is specified.
authorDidier Raboud <odyx@debian.org>
Wed, 7 Mar 2012 12:26:01 +0000 (13:26 +0100)
committerDidier Raboud <odyx@debian.org>
Sun, 11 Mar 2012 16:32:36 +0000 (17:32 +0100)
According to the letter of the LSB:

killproc:"If a signal is specified, (...) the program is sent that signal.
          Otherwise, a SIGTERM followed by a SIGKILL after an unspecified
          number of seconds shall be sent."

According to start-stop-daemon manpage, that's what `--retry 5` does, with `5
seconds` being the `unspecified` of LSB, hence the `--retry 5` is only added
in the case where no signal is specified.

Closes: #650584
Reported-by: Daniel Nelson <torham@connect2.com>
Signed-off-by: Didier Raboud <odyx@debian.org>
init-functions

index d5b697194406680e300dffa81f50675aebb4688b..da3ec1846181d71a2504dc0fab93c5e79123d54a 100644 (file)
@@ -137,7 +137,7 @@ killproc () {
 
     sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
     sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/')
-    if [ -z "$sig" ] || [ "$sig" = 15 ] || [ "$sig" = TERM ]; then
+    if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then
         is_term_sig="terminate_signal"
     fi
     status=0
@@ -147,6 +147,7 @@ killproc () {
                --quiet $name_param || status="$?"
         else
             /sbin/start-stop-daemon --stop \
+               --retry 5 \
                --quiet $name_param || status="$?"
         fi
     else