mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-13 15:47:07 +00:00
lxc-start: fix the container leak when daemonize
When start container with daemon model, we'll have a new daemon process in lxcapi_start, whose c->numthreads is 2, inherited from his father. Even his father return to main(), the lxc_container_put won't affect son's numthreads. So when daemon stops, he should return to main and do lxc_container_put again, rather than exit and leave the container alone. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
7a49a081dd
commit
c3f0f139e1
@ -632,12 +632,10 @@ reboot:
|
||||
goto reboot;
|
||||
}
|
||||
|
||||
if (daemonize) {
|
||||
if (daemonize)
|
||||
lxc_container_put(c);
|
||||
exit (ret == 0 ? true : false);
|
||||
} else {
|
||||
return (ret == 0 ? true : false);
|
||||
}
|
||||
|
||||
return (ret == 0 ? true : false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user