]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: log setns() failure 2349/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 24 May 2018 22:25:16 +0000 (00:25 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 24 May 2018 22:25:16 +0000 (00:25 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index ba737d23911873401180b21a666986dfbe7ae0ea..638e195d6356573d38738d5cd50c743e293ebf54 100644 (file)
@@ -1486,8 +1486,16 @@ static inline int do_share_ns(void *arg)
                        continue;
 
                ret = setns(handler->nsfd[i], 0);
-               if (ret < 0)
+               if (ret < 0) {
+                       /*
+                        * Note that joining a user and/or mount namespace
+                        * requires the process is not multithreaded otherwise
+                        * setns() will fail here.
+                        */
+                       SYSERROR("Failed to inherit %s namespace",
+                                ns_info[i].proc_name);
                        return -1;
+               }
 
                DEBUG("Inherited %s namespace", ns_info[i].proc_name);
        }