From: Christian Brauner Date: Thu, 10 Jan 2019 12:35:42 +0000 (+0100) Subject: start: handle missing CLONE_NEWCGROUP X-Git-Tag: lxc-3.2.0~192^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bca7c59caddb7568b27552cf0138bfafc1fa2d30;p=thirdparty%2Flxc.git 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 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index dae3bcfe5..49c2018ca 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; + if (errno != EINVAL) { + SYSERROR("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