]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgfsng: try to delete parent cgroups
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 25 Aug 2017 09:53:55 +0000 (11:53 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 27 Aug 2017 15:51:28 +0000 (17:51 +0200)
commit92c590ae1ea40bc094603ab49c20b785cc88bb1d
tree36bceafb9e200a2de6741fc168147811736a446a
parent7d531e9ba482947eaf9be3b19949f24b5e78bb44
cgfsng: try to delete parent cgroups

Say we have

    lxc.uts.name = c1
    lxc.cgroup.dir = lxd/a/b/c

the path for the container's cgroup would be

    lxd/a/b/c/c1

When the container is shutdown we should not just try to delete "c1" we should
also try to delete "c", "b", "a", and "lxd". This is to ensure that we don't
leave empty cgroups around thereby increasing the chance that we run into
trouble with cgroup limits. The algorithm for this isn't too costly since we
can simply stop walking upwards at the first rmdir() failure.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/confile.c