mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-06 17:18:10 +00:00
waitpid at abort to make sure we can rmdir cgroups
If we abort the container start, and don't wait for the init task to be reaped after we kill it, then we can't remove the container cgroup because it is not empty. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
39dc698cb4
commit
73e608b21f
@ -451,9 +451,12 @@ static void lxc_fini(const char *name, struct lxc_handler *handler)
|
||||
|
||||
void lxc_abort(const char *name, struct lxc_handler *handler)
|
||||
{
|
||||
int ret, status;
|
||||
|
||||
lxc_set_state(name, handler, ABORTING);
|
||||
if (handler->pid > 0)
|
||||
kill(handler->pid, SIGKILL);
|
||||
while ((ret = waitpid(-1, &status, 0)) > 0) ;
|
||||
}
|
||||
|
||||
#include <sys/reboot.h>
|
||||
|
Loading…
Reference in New Issue
Block a user