Unverified Commit 6d88f7ea by Tycho Andersen Committed by Christian Brauner

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: 's avatarTycho Andersen <tycho@tycho.ws>
parent 50cbe5eb
......@@ -1796,7 +1796,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment