From: Tycho Andersen Date: Fri, 19 Jan 2018 03:29:05 +0000 (+0000) Subject: start: don't return false when the container's init exits nonzero X-Git-Tag: lxc-3.0.0.beta1~74^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb8085399ce511e976678a0012fbf0e5319efe32;p=thirdparty%2Flxc.git start: don't return false when the container's init exits nonzero This seems slightly counter-intuitive, but IMO it's what we want. Basically, ->start() should succeed if the container is spawned correctly (similar to how golang's exec.Cmd.Start() returns nil if the thing spawns correctly), and users can check error_num (i.e. golang's exec.Cmd.Wait()) to see how it exited. This preserves previous behavior, which basically was that start was always successful if the thing actually launched. Since we never kept track of exit codes, this would always succeed too. Now that we do, it doesn't, and this change is required. Signed-off-by: Tycho Andersen --- diff --git a/src/lxc/start.c b/src/lxc/start.c index 00e255a69..bd97545ec 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1823,7 +1823,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler, } lxc_monitor_send_exit_code(name, status, handler->lxcpath); - err = lxc_error_set_and_log(handler->pid, status); + lxc_error_set_and_log(handler->pid, status); out_fini: lxc_delete_network(handler);