The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2145
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) === As lxc_container_new shows errors in stderr, we can safely create the logs after lxc_conf ensures that LXC have a configuration file. Fixes: #2032 Signed-off-by: Marcos Paulo de Souza <marcos.souza....@gmail.com>
From f2df7ca4ea6a1d55f524302a3d9062a112f5b065 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza <marcos.souza....@gmail.com> Date: Thu, 8 Feb 2018 21:27:16 -0200 Subject: [PATCH] lxc_execute.c: Only create logs after checking for lcx_config As lxc_container_new shows errors in stderr, we can safely create the logs after lxc_conf ensures that LXC have a configuration file. Fixes: #2032 Signed-off-by: Marcos Paulo de Souza <marcos.souza....@gmail.com> --- src/lxc/tools/lxc_execute.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lxc/tools/lxc_execute.c b/src/lxc/tools/lxc_execute.c index 3348d7c1c..17569d4a2 100644 --- a/src/lxc/tools/lxc_execute.c +++ b/src/lxc/tools/lxc_execute.c @@ -154,10 +154,6 @@ int main(int argc, char *argv[]) log.quiet = my_args.quiet; log.lxcpath = my_args.lxcpath[0]; - if (lxc_log_init(&log)) - exit(EXIT_FAILURE); - lxc_log_options_no_override(); - /* REMOVE IN LXC 3.0 */ setenv("LXC_UPDATE_CONFIG_FORMAT", "1", 0); @@ -188,6 +184,10 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + if (lxc_log_init(&log)) + exit(EXIT_FAILURE); + lxc_log_options_no_override(); + if (my_args.argc == 0) { if (!set_argv(c->lxc_conf, &my_args)) { fprintf(stderr, "missing command to execute!\n");
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel