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.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index 81fc7d86..afcbb031 100644
--- a/sh/rc-cgroup.sh.in
+++ b/sh/rc-cgroup.sh.in
@@ -70,15 +70,17 @@ cgroup_set_values()
return 0
}
-cgroup_set_limits()
+cgroup_add_service()
{
- openrc_cgroup=/sys/fs/cgroup/openrc
- if [ -d "$openrc_cgroup" ]; then
- cgroup="$openrc_cgroup/$RC_SVCNAME"
+ if [ -d "$1" ]; then
+ cgroup="$1/$RC_SVCNAME"
mkdir -p "$cgroup"
[ -f "$cgroup/tasks" ] && echo 0 > "$cgroup/tasks"
fi
+}
+cgroup_set_limits()
+{
local blkio="${rc_cgroup_blkio:-$RC_CGROUP_BLKIO}"
[ -n "$blkio" ] && cgroup_set_values blkio "$blkio"
@@ -115,7 +117,7 @@ cgroup_cleanup()
cgroup_get_pids || { eend 0 "finished" ; return 0 ; }
sleep 1
done
- done
+ done 2>/dev/null
done
cgroup_get_pids || { eend 0 "finished" ; return 0; }
kill -9 $pids