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

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) ===
The errors in execute_start are important because nothing actually prints
out what error if any there was in these cases, so you're left with an
empty log.

The TRACE logs are simply to tell you which version of start lxc chose to
invoke: exec or start.

Signed-off-by: Tycho Andersen <[email protected]>
From 5219de875fb987b40c3d25ed5d7cbb839bfca31f Mon Sep 17 00:00:00 2001
From: Tycho Andersen <[email protected]>
Date: Tue, 8 May 2018 09:43:19 -0600
Subject: [PATCH] add some TRACE/ERROR reporting

The errors in execute_start are important because nothing actually prints
out what error if any there was in these cases, so you're left with an
empty log.

The TRACE logs are simply to tell you which version of start lxc chose to
invoke: exec or start.

Signed-off-by: Tycho Andersen <[email protected]>
---
 src/lxc/execute.c | 9 +++++++--
 src/lxc/start.c   | 1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/lxc/execute.c b/src/lxc/execute.c
index 0f789e1b2..6248e2d67 100644
--- a/src/lxc/execute.c
+++ b/src/lxc/execute.c
@@ -58,11 +58,15 @@ static int execute_start(struct lxc_handler *handler, void* 
data)
                argc_add += 2;
 
        argv = malloc((argc + argc_add) * sizeof(*argv));
-       if (!argv)
+       if (!argv) {
+               SYSERROR("Allocating init args failed");
                goto out1;
+       }
 
-       if (!my_args->init_path)
+       if (!my_args->init_path) {
+               ERROR("Init path missing?");
                goto out2;
+       }
 
        argv[i++] = my_args->init_path;
 
@@ -142,6 +146,7 @@ int lxc_execute(const char *name, char *const argv[], int 
quiet,
        if (lxc_check_inherited(handler->conf, false, 
&handler->conf->maincmd_fd, 1))
                return -1;
 
+       TRACE("Doing lxc_execute");
        handler->conf->is_execute = 1;
        return __lxc_start(name, handler, &execute_start_ops, &args, lxcpath,
                           backgrounded, error_num);
diff --git a/src/lxc/start.c b/src/lxc/start.c
index d7f079979..ce5cb3366 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1971,6 +1971,7 @@ int lxc_start(const char *name, char *const argv[], 
struct lxc_handler *handler,
                .argv = argv,
        };
 
+       TRACE("Doing lxc_start");
        return __lxc_start(name, handler, &start_ops, &start_arg, lxcpath, 
backgrounded, error_num);
 }
 
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to