From 2f269bdfa30c4798fa0692642e8ff58e8d39e164 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 16 Dec 2008 18:55:36 +0000 Subject: [PATCH] - try ssd for killproc. needs pidfile to work reliably - what values to use for --retry? svn-id: @10037 --- rc.d/init.d/functions | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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##*/} -- 2.44.0