[systemd-devel] remounting root fs outside containers as MS_SHARED

Djalal Harouni tixxdz at opendz.org
Wed May 14 17:31:23 PDT 2014


On Wed, May 14, 2014 at 03:12:55PM -0700, Ani Sinha wrote:
> On Wed, May 14, 2014 at 9:14 AM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Tue, 13.05.14 20:16, Ani Sinha (ani at arista.com) wrote:
> >
> 
> >
> > Why precisely would you want to disable propagation from the root dir?
> >
> 
> The core issue is that pivot_root() syscall breaks if the new_root is
> a mount point under / which is now shared. We use pivot_root() in our
> chroot code.
As Lennart have noted the:
mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) is necessary for things
to continue to work properly... is MS_SLAVE not an option ?

Why pivot_root() fails ?

I remember I've experienced something like this, I'm not sure if it's
the same case, or if this will work for you:

you could bind mount your new_root just before the pivot_root()


-- 
Djalal Harouni
http://opendz.org


More information about the systemd-devel mailing list