From: Serge Hallyn Date: Tue, 14 Apr 2015 14:28:20 +0000 (-0500) Subject: do_lxcap_stop: wait until container is stopped X-Git-Tag: lxc-1.1.3~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16a64224c5417fe26c4a01496656a1a4c78eae3c;p=thirdparty%2Flxc.git do_lxcap_stop: wait until container is stopped 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 --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 6f44975dc..152906f37 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -753,7 +753,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)