From 371828c4a0a23b61d57889b7deb11390b6ff0f3e Mon Sep 17 00:00:00 2001 From: Sukadev Bhattiprolu Date: Mon, 12 Jul 2010 15:13:18 +0200 Subject: [PATCH] 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 --- src/lxc/stop.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) {