Commit 371828c4 by Sukadev Bhattiprolu Committed by Daniel Lezcano

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: 's avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: 's avatarMatt Helsley <matthltc@us.ibm.com> Acked-by: 's avatarDan Smith <danms@us.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent ba31511e
...@@ -83,8 +83,14 @@ extern int lxc_stop_callback(int fd, struct lxc_request *request, ...@@ -83,8 +83,14 @@ extern int lxc_stop_callback(int fd, struct lxc_request *request,
int ret; int ret;
answer.ret = kill(handler->pid, SIGKILL); answer.ret = kill(handler->pid, SIGKILL);
if (!answer.ret) if (!answer.ret) {
return 0; ret = lxc_unfreeze(handler->name);
if (!ret)
return 0;
ERROR("failed to unfreeze container");
answer.ret = ret;
}
ret = send(fd, &answer, sizeof(answer), 0); ret = send(fd, &answer, sizeof(answer), 0);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment