From: Serge Hallyn Date: Thu, 30 May 2013 16:22:16 +0000 (-0500) Subject: waitpid at abort to make sure we can rmdir cgroups X-Git-Tag: lxc-1.0.0.alpha1~1^2~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=73e608b21f73509c5f8c7a948cc6d4b0898edb2c;p=thirdparty%2Flxc.git waitpid at abort to make sure we can rmdir cgroups If we abort the container start, and don't wait for the init task to be reaped after we kill it, then we can't remove the container cgroup because it is not empty. Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/start.c b/src/lxc/start.c index d43d58073..5092b51cf 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -451,9 +451,12 @@ static void lxc_fini(const char *name, struct lxc_handler *handler) void lxc_abort(const char *name, struct lxc_handler *handler) { + int ret, status; + lxc_set_state(name, handler, ABORTING); if (handler->pid > 0) kill(handler->pid, SIGKILL); + while ((ret = waitpid(-1, &status, 0)) > 0) ; } #include