]> git.ipfire.org Git - thirdparty/lxc.git/commit
start: don't return false when the container's init exits nonzero
authorTycho Andersen <tycho@tycho.ws>
Fri, 19 Jan 2018 03:29:05 +0000 (03:29 +0000)
committerTycho Andersen <tycho@tycho.ws>
Fri, 19 Jan 2018 03:44:24 +0000 (03:44 +0000)
commiteb8085399ce511e976678a0012fbf0e5319efe32
tree73c69711ef47d6d2a2ced5da9995197e3a3f2c68
parentcd5177e9e36b36869c99ee8b850b9853a344b179
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 <tycho@tycho.ws>
src/lxc/start.c