aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-14 11:40:26 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-14 16:17:20 -0500
commit6a5ca2ab368d0a85f51bb559672dba2e3ffcc6be (patch)
tree07ae9f3bb0c882eddcec43e01402d23f861a4d5e /sh
parent2b0345165e5af57ca61a4000c3671bbe6d677cf9 (diff)
make the procedure for killing child processes of services configurable
Diffstat (limited to 'sh')
-rw-r--r--sh/rc-cgroup.sh.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index 47a007b6..4b713594 100644
--- a/sh/rc-cgroup.sh.in
+++ b/sh/rc-cgroup.sh.in
@@ -204,10 +204,13 @@ cgroup_cleanup()
local pids
pids="$(cgroup_get_pids)"
if [ -n "${pids}" ]; then
- kill -s TERM "${pids}"
- sleep 1
- pids="$(cgroup_get_pids)"
- [ -n "${pids}" ] &&
- kill -s KILL "${pids}"
+ kill -s "${stopsig:-SIGTERM}" ${pids} 2> /dev/null
+ kill -s SIGCONT ${pids} 2> /dev/null
+ yesno "${rc_send_sighup:-no}" &&
+ kill -s SIGHUP ${pids} 2> /dev/null
+ sleep "${rc_timeout_stopsec:-90}"
+ yesno "${rc_send_sigkill:-yes}" &&
+ kill -s SIGKILL ${pids} 2> /dev/null
fi
+ eend 0
}