make the procedure for killing child processes of services configurable

This commit is contained in:
William Hubbs
2017-09-14 11:40:26 -05:00
parent 2b0345165e
commit 6a5ca2ab36
2 changed files with 34 additions and 8 deletions

View File

@@ -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
}