]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
do_lxcap_stop: wait until container is stopped
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 14 Apr 2015 14:28:20 +0000 (09:28 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 17:03:02 +0000 (13:03 -0400)
In the past, lxc-cmd-stop would wait until the command pipe was closed
before returning, ensuring that the container monitor had exited.
Now that we accept the actual success return value, lxcapi_stop can
return success before the monitor has fully exited.

So explicitly wait for the container to stop, when lxc-cmd-stop returned
success.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 08d788a7a2466a1a27e46493eaf8f5dbbcb2b363..c2a18f2cb6bca3b540c33091acdd05a1c75c9e7c 100644 (file)
@@ -735,7 +735,10 @@ static bool lxcapi_stop(struct lxc_container *c)
 
        ret = lxc_cmd_stop(c->name, c->config_path);
 
-       return ret == 0;
+       if (ret == 0)
+               return do_lxcapi_wait(c, "STOPPED", 10);
+
+       return false;
 }
 
 static int do_create_container_dir(const char *path, struct lxc_conf *conf)