1 From 6154a5cecca4c7cf7252a230f81d2fa913c0bfab Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= <glen@pld-linux.org>
3 Date: Wed, 5 Dec 2012 20:54:15 +0000
4 Subject: [PATCH] killproc: improve experimental start-stop-daemon based
7 do not send --retry, in case we specify a signal to kill (usually HUP)
8 as processes do not usually exit (remove their pid from pidfile) if they receive HUP
13 lib/functions | 12 ++++++++++--
14 1 file changed, 10 insertions(+), 2 deletions(-)
16 diff --git a/lib/functions b/lib/functions
17 index 3b9fc39..e7debac 100644
18 --- a/rc.d/init.d/functions
19 +++ b/rc.d/init.d/functions
20 @@ -754,9 +754,17 @@ killproc() {
21 # experimental start-stop-daemon based killing.
22 # works only with pidfile
23 if is_no "$RC_LOGGING" && [ "$pidfile" ]; then
24 - local sig=${killlevel:--TERM}
25 + local sig=${killlevel:--TERM} retry
26 + # retry only if signal is not specified,
27 + # as otherwise impossible to send HUP if process pid stays in pidfile.
28 + if [ "${killlevel+set}" = "set" ]; then
29 + # if we send HUP it's ok if process does not die
32 + retry="--retry ${sig#-}/10/${sig#-}/60/KILL/10"
34 /sbin/start-stop-daemon -q --stop \
35 - --retry ${sig#-}/10/${sig#-}/60/KILL/10 \
38 ${pidfile:+--pidfile $pidfile}