Subject: Default CGROUP_SUBSYS needs to exclude "ns"
From: ben@bristolwireless.net
Date: Thu, 25 Feb 2010 13:18:08 +0000
Thu, 25 Feb 2010 13:18:08 +0000
Hi all,

I've found that the default mounted cgroup subsystem in util-vserver  
init script are set by the variable CGROUP_SUBSYS. It is currently set  
to "all" by default. I've also noticed that on kernels with  
CONFIG_CGROUP_NS=y this mean that the "ns", meaning guests can't be run.

IMHO the default subsystems mounted should be all those present on the  
system, excluding ns, so that Linux-Vserver may work on the widest  
range of kernels. I wrote a script to set CGROUP_SUBSYS correctly in  
the default case. My BASH is probably embarrassingly bad, but it gets  
the job done, creating a comma separated list of subsystems:

#default to using all cgroup subsystems excluding ns
for SYS in `cat /proc/cgroups | grep -v subsys_name | grep -v ns | awk  
'{print $1}'` ; do
if [ "${CGROUP_SUBSYS}" = "" ] ; then
CGROUP_SUBSYS=${SYS}
else
CGROUP_SUBSYS="${CGROUP_SUBSYS},${SYS}"
fi
done


Cheers,
==
 From Ben Green


["application/pgp-signature" not shown]