aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-cgroup.sh.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-14 10:44:52 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-09-14 10:44:52 -0500
commit8885580986ab8adc951fe32b9323c8b16130fb4f (patch)
treef334b4dff52f9254bdb06d403cb8350fea1fb4f7 /sh/rc-cgroup.sh.in
parent6d7713a758b7e78f05e6a3cc101f862d28d778ab (diff)
rc-cgroup.sh: move cgroup_cleanup to the end of the file
Diffstat (limited to 'sh/rc-cgroup.sh.in')
-rw-r--r--sh/rc-cgroup.sh.in38
1 files 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"
+}