]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc startup: manually mark every shared mount entry as slave
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 16 Apr 2014 16:01:22 +0000 (11:01 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 28 Apr 2014 15:18:47 +0000 (10:18 -0500)
commite995d7a269b3f158055e94a5f043211cd81a6966
tree6895312535c5475bf555ffccb9eb3dc0005dca15
parent0e98b3bd319e887e76e37b513545d0e8eb893f24
lxc startup: manually mark every shared mount entry as slave

If you 'ip netns add x1', this creates /run/netns and /run/netns/x1
as shared mounts.  When a container starts, it umounts these after
pivot_root, and the umount is propagated to the host.

Worse, doing mount("", "/", NULL, MS_SLAVE|MS_REC, NULL) does not
suffice to change those, even after binding /proc/mounts onto
/etc/mtab.

So, I give up.  Do this manually, walking over /proc/self/mountinfo
and changing the mount propagation on everything marked as shared.

With this patch, lxc-start no longer unmounts /run/netns/* on the
host.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c