From 6a5ca2ab368d0a85f51bb559672dba2e3ffcc6be Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 14 Sep 2017 11:40:26 -0500 Subject: make the procedure for killing child processes of services configurable --- sh/rc-cgroup.sh.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'sh') 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 } -- cgit v1.2.3