]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
monitor: add more logging 1324/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 Nov 2016 06:40:59 +0000 (07:40 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 26 Nov 2016 06:40:59 +0000 (07:40 +0100)
Execing lxc-monitord is quite a crucial step so let's be very obsessive about
logging possible errors to guide us in debugging.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/monitor.c

index 1afaa5ae2364daa251343d1220a4fdb2c3936045..793fbde098d595d891cd120bfd0936b3c8734dce 100644 (file)
@@ -349,18 +349,23 @@ int lxc_monitord_spawn(const char *lxcpath)
        }
 
        lxc_check_inherited(NULL, true, pipefd[1]);
-       if (null_stdfds() < 0)
+       if (null_stdfds() < 0) {
+               SYSERROR("Failed to dup2() standard file descriptors to /dev/null.");
                exit(EXIT_FAILURE);
+       }
 
        close(pipefd[0]);
 
        ret = snprintf(pipefd_str, __INT_LEN, "%d", pipefd[1]);
-       if (ret < 0 || ret >= __INT_LEN)
+       if (ret < 0 || ret >= __INT_LEN) {
+               ERROR("Failed to create pid argument to pass to monitord.");
                exit(EXIT_FAILURE);
+       }
 
        DEBUG("Using pipe file descriptor %d for monitord.", pipefd[1]);
 
        execvp(args[0], args);
+       ERROR("Failed to exec lxc-monitord.");
 
        exit(EXIT_FAILURE);
 }