]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgroup: recursively delete cgroups when asked
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 11 Jan 2014 06:14:26 +0000 (00:14 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 13 Jan 2014 00:25:08 +0000 (19:25 -0500)
commit603c64c289e0413c26f650fbf0fd5adcfed0c153
tree9596afd3966311c86be5991fc3bcba50dfb65c46
parent71d3a6590fe665421d7a0026d699b0654ddfc7f6
cgroup: recursively delete cgroups when asked

Currently when a container is shut down, lxc walks the set of all
cgroup paths it created, in reverse order, and tries to remove them.
This doesn't suffice if the container has also created new cgroups.

It'd be impolite to recursively remove all the cgroup paths we created,
since this can include '/lxc' and thereunder all other containers
started since.

This patch changes container shutdown to only delete the container's own
path, but do so recursively.  Note that if we fail during startup,
the container won't have created any cgroup paths so it the old
way works fine.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgroup.c