make the container exit code propagate to lxc-start exit code when appropriate

Signed-off-by: Rodrigo Sampaio Vaz <rodrigo@heroku.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Rodrigo Vaz 2014-07-03 15:39:51 -03:00 committed by Stéphane Graber
parent 9a7c2aba46
commit d4ef230cc9
2 changed files with 4 additions and 0 deletions

View File

@ -336,6 +336,9 @@ int main(int argc, char *argv[])
ERROR("To get more details, run the container in foreground mode.");
ERROR("Additional information can be obtained by setting the "
"--logfile and --log-priority options.");
err = c->error_num;
lxc_container_put(c);
return err;
}
out:

View File

@ -673,6 +673,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv
reboot:
conf->reboot = 0;
ret = lxc_start(c->name, argv, conf, c->config_path);
c->error_num = ret;
if (conf->reboot) {
INFO("container requested reboot");