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.kubik@canonical.com> Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2fa5dff9
...@@ -1252,11 +1252,17 @@ static int do_start(void *data) ...@@ -1252,11 +1252,17 @@ static int do_start(void *data)
if (handler->ns_clone_flags & CLONE_NEWCGROUP) { if (handler->ns_clone_flags & CLONE_NEWCGROUP) {
ret = unshare(CLONE_NEWCGROUP); ret = unshare(CLONE_NEWCGROUP);
if (ret < 0) { if (ret < 0) {
INFO("Failed to unshare CLONE_NEWCGROUP"); if (errno != EINVAL) {
SYSERROR("Failed to unshare CLONE_NEWCGROUP");
goto out_warn_father; 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 /* Add the requested environment variables to the current environment to
* allow them to be used by the various hooks, such as the start hook * allow them to be used by the various hooks, such as the start hook
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment