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-2.0.0.beta1~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fef9aa89e99285609d51848623f84ecd3a3109df;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 5b96b8c50..e86151c91 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -852,7 +852,10 @@ static bool do_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; } WRAP_API(bool, lxcapi_stop)