Fix 'cgroups not mounted' error in U12.10

'mount' shows something slightly different in Ubuntu 12.10:

cgroup on /sys/fs/cgroup type tmpfs (rw,uid=0,gid=0,mode=0755)

Note the lack of a plural on first word cgroup, which has changed.

Still mounted at /sys/fs/cgroup, so check for both possibilities
when instantiated CPU-limited hosts.
This commit is contained in:
Brandon Heller
2012-11-13 20:53:13 -08:00
parent 36c9b040ca
commit 8a1264e266
+2 -1
View File
@@ -361,7 +361,8 @@ def mountCgroups():
mounts = quietRun( 'mount' )
cgdir = '/sys/fs/cgroup'
csdir = cgdir + '/cpuset'
if 'cgroups on %s' % cgdir not in mounts:
if ('cgroup on %s' % cgdir not in mounts and
'cgroups on %s' % cgdir not in mounts):
raise Exception( "cgroups not mounted on " + cgdir )
if 'cpuset on %s' % csdir not in mounts:
errRun( 'mkdir -p ' + csdir )