]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
start: CLONE_NEWCGROUP after we have setup cgroups
authorChristian Brauner <christian.brauner@canonical.com>
Thu, 3 Nov 2016 20:24:31 +0000 (21:24 +0100)
committerChristian Brauner <christian.brauner@canonical.com>
Thu, 3 Nov 2016 20:41:46 +0000 (21:41 +0100)
commitdeefdf8a791cf969ba25a5847844bdf0e58c8f34
tree4946b4794f7993e4e80e18083a59f64b211922f3
parent293eeeac727adf092f149620e988a1fdb00eac37
start: CLONE_NEWCGROUP after we have setup cgroups

If we do it earlier we end up with a wrong view of /proc/self/cgroup. For
example, assume we unshare(CLONE_NEWCGROUP) first, and then create the cgroup
for the container, say /sys/fs/cgroup/cpuset/lxc/c, then /proc/self/cgroup
would show us:

     8:cpuset:/lxc/c

whereas it should actually show

     8:cpuset:/

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/start.c