]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups: try to load cgmanager first
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 16 Mar 2016 06:02:10 +0000 (23:02 -0700)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 16 Mar 2016 23:33:03 +0000 (16:33 -0700)
If cgmanager is running, use it.  This allows the admin to simply
stop cgmanager if they don't want to use it.  The other way there
is no way to choose to use cgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgroup.c
src/tests/lxc-test-automount

index 684a3c3df65638b53baf059a232ddfad30399e20..1a92ef42a3f34534d41780448e50ace2b1d4c425 100644 (file)
@@ -46,11 +46,11 @@ void cgroup_ops_init(void)
        }
 
        DEBUG("cgroup_init");
-       ops = cgfsng_ops_init();
        #if HAVE_CGMANAGER
-       if (!ops)
-               ops = cgm_ops_init();
+       ops = cgm_ops_init();
        #endif
+       if (!ops)
+               ops = cgfsng_ops_init();
        if (!ops)
                ops = cgfs_ops_init();
        if (ops)
index 6a06d7acdbec68ea09688d2a2412c785d4b8e67f..450537537c248d7d7189b714404080967154c357 100644 (file)
@@ -24,6 +24,9 @@
 
 [ -f /proc/self/ns/cgroup ] && exit 0
 
+# cgmanager doesn't do the same cgroup filesystem mounting
+cgm ping && exit 0
+
 set -ex
 
 cleanup() {