]> git.pld-linux.org Git - packages/rc-scripts.git/blob - 0001-killproc-improve-experimental-start-stop-daemon-base.patch
backport svn-id: @12662 -- do not use `:>` which aborts whole script on error
[packages/rc-scripts.git] / 0001-killproc-improve-experimental-start-stop-daemon-base.patch
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
5  killing.
6
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
9
10
11 svn-id: @12603
12 ---
13  lib/functions | 12 ++++++++++--
14  1 file changed, 10 insertions(+), 2 deletions(-)
15
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
30 +                       retry="--oknodo"
31 +               else
32 +                       retry="--retry ${sig#-}/10/${sig#-}/60/KILL/10"
33 +               fi
34                 /sbin/start-stop-daemon -q --stop \
35 -                       --retry ${sig#-}/10/${sig#-}/60/KILL/10 \
36 +                       $retry \
37                         -s ${sig#-} \
38                         ${pidfile:+--pidfile $pidfile}
39                 result=$?
40 -- 
41 1.9.1
42
This page took 0.086306 seconds and 3 git commands to generate.