cgroups: fix cgroup subsystem mounting

Originally, we aborted all of the cgroup setup if /sys/fs/cgroup/openrc
was already mounted. This  caused an issue in lxc containers, so we
should always allow the subsystems to be mounted.

X-Gentoo-Bug: 520606
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520606
This commit is contained in:
William Hubbs 2014-08-22 12:41:55 -05:00
parent 7b9fe5fced
commit 4f4f00d612

View File

@ -100,14 +100,15 @@ mount_misc()
mount_cgroups()
{
mountinfo -q /sys/fs/cgroup || return 0
mountinfo -q /sys/fs/cgroup/openrc || return 0
local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup \
-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
openrc /sys/fs/cgroup/openrc
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
if ! mountinfo -q /sys/fs/cgroup/openrc; then
local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup \
-o none,${sysfs_opts},name=openrc,release_agent="$agent" \
openrc /sys/fs/cgroup/openrc
echo 1 > /sys/fs/cgroup/openrc/notify_on_release
fi
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do