From: Sukadev Bhattiprolu Date: Mon, 12 Jul 2010 13:13:18 +0000 (+0200) Subject: Must unfreeze while stopping container X-Git-Tag: lxc-0.7.2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=371828c4a0a23b61d57889b7deb11390b6ff0f3e;p=thirdparty%2Flxc.git Must unfreeze while stopping container As pointed out by Dan Smith, when a container is being stopped, it must also be unfrozen after posting the SIGKILL. Otherwise if the container is frozen when the SIGKILL is posted, the SIGKILL will remain pending and the lxc-stop command will block until lxc-unfreeze is explicitly called). (lxc-stop waits for the container to exit and close the socket but since the container is frozen, lxc-stop will block). Signed-off-by: Sukadev Bhattiprolu Acked-by: Matt Helsley Acked-by: Dan Smith Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/stop.c b/src/lxc/stop.c index b751af51b..f441e46c6 100644 --- a/src/lxc/stop.c +++ b/src/lxc/stop.c @@ -83,8 +83,14 @@ extern int lxc_stop_callback(int fd, struct lxc_request *request, int ret; answer.ret = kill(handler->pid, SIGKILL); - if (!answer.ret) - return 0; + if (!answer.ret) { + ret = lxc_unfreeze(handler->name); + if (!ret) + return 0; + + ERROR("failed to unfreeze container"); + answer.ret = ret; + } ret = send(fd, &answer, sizeof(answer), 0); if (ret < 0) {