aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-cgroup.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'sh/rc-cgroup.sh.in')
-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
}