]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
make the container exit code propagate to lxc-start exit code when appropriate
authorRodrigo Vaz <rodrigo@heroku.com>
Thu, 3 Jul 2014 18:39:51 +0000 (15:39 -0300)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 3 Jul 2014 19:58:28 +0000 (15:58 -0400)
Signed-off-by: Rodrigo Sampaio Vaz <rodrigo@heroku.com>
Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_start.c
src/lxc/lxccontainer.c

index 1d8145fcd1a9dff96f1850dcc03e7855ffde94ef..7924ab1ab62ac6c87b337a14c7a15b09597d7bf5 100644 (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:
index 62e38d7a24372adb300339cbd3de40e497b4945d..31f5bb030d0ef5b76b315a0764315deac728ad85 100644 (file)
@@ -669,6 +669,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");