]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-start: fix the container leak when daemonize
authorQiang Huang <h.huangqiang@huawei.com>
Sat, 18 Jan 2014 06:59:58 +0000 (14:59 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 19 Jan 2014 00:57:39 +0000 (19:57 -0500)
commitc3f0f139e155f53c83e0a81f14094e9d0f40e8e9
tree4e84233d9dbb1e08afa19132dbadb29ec1be4b2f
parent7a49a081dd1d4f92e3c82df344709e3206457e46
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>
src/lxc/lxccontainer.c