aboutsummaryrefslogtreecommitdiff
path: root/sh/rc-cgroup.sh.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2013-06-25 10:50:13 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2013-06-25 10:58:27 -0500
commit2391ddff772ce541bc2237c89a2792a0b85e076c (patch)
tree8d5583ab9caff5d9eca10d2e2be8376f0b36934f /sh/rc-cgroup.sh.in
parent02a7d3573d551c5d169eaa465ef90349d1ee367e (diff)
cgroups: add support for systemd cgroup hierarchy
The systemd cgroup hierarchy support is being added so we can run logind outside of systemd. This is needed because software that was using consolekit is now migrating to logind. We do not create this hierarchy, we just add services to it if it exists.
Diffstat (limited to 'sh/rc-cgroup.sh.in')
-rw-r--r--sh/rc-cgroup.sh.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in
index d96aa164..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"