From: Elan Ruusamäe Date: Tue, 16 Dec 2008 18:55:36 +0000 (+0000) Subject: - try ssd for killproc. needs pidfile to work reliably X-Git-Tag: 0.4.1.26~4 X-Git-Url: http://git.pld-linux.org/?p=projects%2Frc-scripts.git;a=commitdiff_plain;h=2f269bdfa30c4798fa0692642e8ff58e8d39e164 - try ssd for killproc. needs pidfile to work reliably - what values to use for --retry? svn-id: @10037 --- diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index aacd423c..581866fe 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -668,9 +668,27 @@ killproc() { killlevel=$2 else notset=1 - killlevel="-9" + killlevel="-KILL" fi + # experimental start-stop-daemon based killing. + # works only with pidfile + if is_no "$RC_LOGGING" && [ "$pidfile" ]; then + local sig=${killevel:--TERM} + /sbin/start-stop-daemon --stop \ + --retry ${sig#-}/10/${sig#-}/60/KILL/10 \ + -s ${sig#-} \ + ${pidfile:+--pidfile $pidfile} + result=$? + if [ "$result" -eq 0 ]; then + ok + else + fail + fi + return $result + fi + + # Save basename. base=${1##*/}