mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 06:06:57 +00:00
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 <sukadev@linux.vnet.ibm.com> Acked-by: Matt Helsley <matthltc@us.ibm.com> Acked-by: Dan Smith <danms@us.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
ba31511e05
commit
371828c4a0
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user