From de5cee2c217e5ed606db19ca1433686048303297 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 26 Jan 2012 11:02:00 -0600 Subject: [PATCH] cgroups: make sure /sys/fs/cgroup is a mount point We need to make sure this directory is a mount point before we add the control groups. Reported-by: Andrej Filipcic X-Gentoo-Bug: 400903 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=400903 --- init.d/sysfs.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/init.d/sysfs.in b/init.d/sysfs.in index 962fcfdb..8ba988a0 100644 --- a/init.d/sysfs.in +++ b/init.d/sysfs.in @@ -74,10 +74,8 @@ mount_misc() mount_cgroups() { - yesno ${rc_cgroups:-YES} || return 0 - if [ ! -e /proc/cgroups ]; then - return 0 - fi + yesno ${rc_cgroups:-YES} && [ -e /proc/cgroups ] && \ + mountinfo -q /sys/fs/cgroup || return 0 local agent="@LIBEXECDIR@/sh/cgroup-release-agent.sh" mkdir /sys/fs/cgroup/openrc