diff options
author | William Hubbs <williamh@gentoo.org> | 2011-11-19 18:15:46 -0600 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2011-11-20 14:07:46 -0600 |
commit | d8bbeb184f462199582fa265c9b681288884ecd9 (patch) | |
tree | 69f41c7c2bf83eaeddad57e177505b1c2abacca4 /init.d | |
parent | 453d13296d84472e6317472c2b27015b3ca612c4 (diff) |
CGroups: create the openrc cgroup hierarchy
Openrc will create a cgroup hierarchy called openrc which will have all
services it starts and all subsystems attached to it. If you need other
groups/hierarchies, please use libcgroup.
Diffstat (limited to 'init.d')
-rw-r--r-- | init.d/sysfs.in | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/init.d/sysfs.in b/init.d/sysfs.in index a536d5fd..d57c3883 100644 --- a/init.d/sysfs.in +++ b/init.d/sysfs.in @@ -62,13 +62,24 @@ mount_misc() fi # Setup Kernel Support for cgroup - if [ -d /sys/fs/cgroup ] && ! mountinfo -q /sys/fs/cgroup; then - if grep -qs cgroup /proc/filesystems; then + if [ -d /sys/fs/cgroup ]; then + if grep -qs cgroup /proc/filesystems && \ + ! mountinfo -q /sys/fs/cgroup; then ebegin "Mounting cgroup filesystem" mount -n -t tmpfs -o nodev,noexec,nosuid \ cgroup /sys/fs/cgroup eend $? fi + if ! mountinfo -q /sys/fs/cgroup/openrc; then + ebegin "creating openrc control group" + mkdir /sys/fs/cgroup/openrc + mount -n -t cgroup -o nodev,noexec,nosuid \ + openrc /sys/fs/cgroup/openrc + echo 1 > /sys/fs/cgroup/openrc/notify_on_release + echo @LIBEXECDIR@/sh/cgroup-release-agent.sh \ + > /sys/fs/cgroup/openrc/release_agent + eend + fi fi } |