From d8bbeb184f462199582fa265c9b681288884ecd9 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Sat, 19 Nov 2011 18:15:46 -0600 Subject: 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. --- init.d/sysfs.in | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'init.d') diff --git a/init.d/sysfs.in b/init.d/sysfs.in index a536d5f..d57c388 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 } -- cgit v1.2.3