From 8a1264e266736d2c7dadd5a2a0e1e6ecf487e405 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Tue, 13 Nov 2012 20:53:13 -0800 Subject: [PATCH] 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. --- mininet/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mininet/util.py b/mininet/util.py index 1fd9cae..0c7c870 100644 --- a/mininet/util.py +++ b/mininet/util.py @@ -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 )