aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge E. Hallyn <serge.hallyn@canonical.com>2011-10-24 14:38:30 +0200
committerDaniel Lezcano <daniel.lezcano@free.fr>2011-10-24 14:38:30 +0200
commit3e2981d4599962ec069c249460d86ce8ebec7644 (patch)
treeaf4abf731465aed09818e9a74bfdd477bf082d2b
parentLet sshd template work on ubuntu systems. (diff)
downloadlxc-3e2981d4599962ec069c249460d86ce8ebec7644.tar.gz
lxc-3e2981d4599962ec069c249460d86ce8ebec7644.tar.bz2
lxc-3e2981d4599962ec069c249460d86ce8ebec7644.zip
Accurately detect whether a system supports clone_children
If multiple cgroups are mounted under /sys/fs/cgroup, then the original check ends up looking for /sys/fs/cgroup/cgroup.clone_children, which does not exist because that is just a tmpfs. So make sure to check an actual cgroupfs. Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rwxr-xr-xsrc/lxc/lxc-checkconfig.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lxc/lxc-checkconfig.in b/src/lxc/lxc-checkconfig.in
index 5dcf3a4..30f6186 100755
--- a/src/lxc/lxc-checkconfig.in
+++ b/src/lxc/lxc-checkconfig.in
@@ -63,7 +63,12 @@ echo -n "Multiple /dev/pts instances: " && is_enabled DEVPTS_MULTIPLE_INSTANCES
echo
echo "--- Control groups ---"
-CGROUP_MNT_PATH=$(grep -m1 "^cgroup" /proc/self/mounts | awk '{ print $2 }')
+print_cgroups() {
+ # print all mountpoints for cgroup filesystems
+ awk '$1 !~ /#/ && $3 == mp { print $2; } ; END { exit(0); } ' "mp=$1" "$2" ;
+}
+
+CGROUP_MNT_PATH=`print_cgroups cgroup /proc/self/mounts | head -1`
echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes