mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
lxc: force kill of init process by sending SIGKILL if needed
Init process may remain after sending SIGTERM for some reason. For example, if original init program is used, it is definitely not killed by SIGTERM. * src/lxc/lxc_controller.c: kill with SIGKILL if SIGTERM wasn't sufficient
This commit is contained in:
parent
ae3d31bf4f
commit
7af5f4689f
@ -663,7 +663,11 @@ cleanup:
|
||||
close(containerPty);
|
||||
|
||||
if (container > 1) {
|
||||
int status;
|
||||
kill(container, SIGTERM);
|
||||
if (!(waitpid(container, &status, WNOHANG) == 0 &&
|
||||
WIFEXITED(status)))
|
||||
kill(container, SIGKILL);
|
||||
waitpid(container, NULL, 0);
|
||||
}
|
||||
return rc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user