[lxc-devel] [PATCH] lxc-checkconfig takes into account cgroup.clone_children

Daniel Lezcano daniel.lezcano at free.fr
Tue Aug 9 18:04:34 UTC 2011


Take into account we may have the clone_children flag on the cgroup,
so we ignore cgroup namespace in this case.

Signed-off-by: Daniel Lezcano <dlezcano at fr.ibm.com>
---
 src/lxc/lxc-checkconfig.in |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/lxc/lxc-checkconfig.in b/src/lxc/lxc-checkconfig.in
index ab27b9c..5dcf3a4 100755
--- a/src/lxc/lxc-checkconfig.in
+++ b/src/lxc/lxc-checkconfig.in
@@ -62,8 +62,17 @@ echo -n "Network namespace: " && is_enabled CONFIG_NET_NS
 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 }')
+
 echo -n "Cgroup: " && is_enabled CONFIG_CGROUPS yes
-echo -n "Cgroup namespace: " && is_enabled CONFIG_CGROUP_NS
+
+if [ -f $CGROUP_MNT_PATH/cgroup.clone_children ]; then
+    echo -n "Cgroup clone_children flag: " &&
+    $SETCOLOR_SUCCESS && echo -e "enabled" && $SETCOLOR_NORMAL
+else
+    echo -n "Cgroup namespace: " && is_enabled CONFIG_CGROUP_NS yes
+fi
 echo -n "Cgroup device: " && is_enabled CONFIG_CGROUP_DEVICE
 echo -n "Cgroup sched: " && is_enabled CONFIG_CGROUP_SCHED
 echo -n "Cgroup cpu account: " && is_enabled CONFIG_CGROUP_CPUACCT
-- 
1.7.4.1





More information about the lxc-devel mailing list