commit: 8885580986ab8adc951fe32b9323c8b16130fb4f Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com> AuthorDate: Thu Sep 14 15:44:52 2017 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Thu Sep 14 15:44:52 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=88855809
rc-cgroup.sh: move cgroup_cleanup to the end of the file sh/rc-cgroup.sh.in | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index 40501f22..1bf819e7 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -134,25 +134,6 @@ cgroup_set_limits() return 0 } -cgroup_cleanup() -{ - cgroup_running || return 0 - ebegin "starting cgroups cleanup" - for sig in TERM QUIT INT; do - cgroup_get_pids || { eend 0 "finished" ; return 0 ; } - for i in 0 1; do - kill -s $sig $pids - for j in 0 1 2; do - cgroup_get_pids || { eend 0 "finished" ; return 0 ; } - sleep 1 - done - done 2>/dev/null - done - cgroup_get_pids || { eend 0 "finished" ; return 0; } - kill -9 $pids - eend $(cgroup_running && echo 1 || echo 0) "fail to stop all processes" -} - cgroup2_find_path() { case "${rc_cgroup_mode:-hybrid}" in @@ -203,3 +184,22 @@ cgroup2_set_limits() IFS="$OIFS" return 0 } + +cgroup_cleanup() +{ + cgroup_running || return 0 + ebegin "starting cgroups cleanup" + for sig in TERM QUIT INT; do + cgroup_get_pids || { eend 0 "finished" ; return 0 ; } + for i in 0 1; do + kill -s $sig $pids + for j in 0 1 2; do + cgroup_get_pids || { eend 0 "finished" ; return 0 ; } + sleep 1 + done + done 2>/dev/null + done + cgroup_get_pids || { eend 0 "finished" ; return 0; } + kill -9 $pids + eend $(cgroup_running && echo 1 || echo 0) "fail to stop all processes" +}