The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2780

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
If cgroup namespaces are not supported we should just record it in the
log and move on.

Cc: Ondrej Kubik <ondrej.ku...@canonical.com>
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From ca881b344ebd55b9d141c85d248b0583638c24f5 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Thu, 10 Jan 2019 13:35:42 +0100
Subject: [PATCH] start: handle missing CLONE_NEWCGROUP

If cgroup namespaces are not supported we should just record it in the
log and move on.

Cc: Ondrej Kubik <ondrej.ku...@canonical.com>
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/start.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index dae3bcfe5..22de82333 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1252,10 +1252,16 @@ static int do_start(void *data)
        if (handler->ns_clone_flags & CLONE_NEWCGROUP) {
                ret = unshare(CLONE_NEWCGROUP);
                if (ret < 0) {
-                       INFO("Failed to unshare CLONE_NEWCGROUP");
-                       goto out_warn_father;
+                       /* This kernel does*/
+                       if (errno != EINVAL) {
+                               INFO("Failed to unshare CLONE_NEWCGROUP");
+                               goto out_warn_father;
+                       }
+                       handler->ns_clone_flags &= ~CLONE_NEWCGROUP;
+                       SYSINFO("Kernel does not support CLONE_NEWCGROUP");
+               } else {
+                       INFO("Unshared CLONE_NEWCGROUP");
                }
-               INFO("Unshared CLONE_NEWCGROUP");
        }
 
        /* Add the requested environment variables to the current environment to
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to