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

2014-05-15 Thread Lennart Poettering
On Thu, 15.05.14 10:22, Ani Sinha (a...@arista.com) wrote: > > Note that systemd itself can do pivot_root() for you. See "systemctl > > switch-root". Isn't that enough for your needs? > > > > If not, please have a look how it is implemented in systemd: > > > > http://cgit.freedesktop.org/systemd/

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

2014-05-15 Thread Ani Sinha
On Thu, May 15, 2014 at 3:25 AM, Lennart Poettering wrote: >> How do you propose softwares fix that? > > Note that systemd itself can do pivot_root() for you. See "systemctl > switch-root". Isn't that enough for your needs? > > If not, please have a look how it is implemented in systemd: > > htt

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

2014-05-15 Thread Djalal Harouni
On Wed, May 14, 2014 at 10:17:59PM -0700, Ani Sinha wrote: > >> > >> Why pivot_root() fails ? > > > > pivot_root() fails because of the following code in linux kernel : > > > > http://lxr.free-electrons.com/source/fs/namespace.c#L2730 > > > > any code that calls pivot_root() under / will fail with

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

2014-05-15 Thread Lennart Poettering
On Wed, 14.05.14 15:12, Ani Sinha (a...@arista.com) wrote: > > On Wed, May 14, 2014 at 9:14 AM, Lennart Poettering > wrote: > > On Tue, 13.05.14 20:16, Ani Sinha (a...@arista.com) wrote: > > > > > > > Why precisely would you want to disable propagation from the root dir? > > > > The core issue

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

2014-05-14 Thread Ani Sinha
>> >> Why pivot_root() fails ? > > pivot_root() fails because of the following code in linux kernel : > > http://lxr.free-electrons.com/source/fs/namespace.c#L2730 > > any code that calls pivot_root() under / will fail with EINVAL. > This is the redhat bug that discusses the kernel behavior : htt

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

2014-05-14 Thread Ani Sinha
On Wed, May 14, 2014 at 5:31 PM, Djalal Harouni wrote: > On Wed, May 14, 2014 at 03:12:55PM -0700, Ani Sinha wrote: >> On Wed, May 14, 2014 at 9:14 AM, Lennart Poettering >> wrote: >> > On Tue, 13.05.14 20:16, Ani Sinha (a...@arista.com) wrote: >> > >> >> > >> > Why precisely would you want to di

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

2014-05-14 Thread Djalal Harouni
On Wed, May 14, 2014 at 03:12:55PM -0700, Ani Sinha wrote: > On Wed, May 14, 2014 at 9:14 AM, Lennart Poettering > wrote: > > On Tue, 13.05.14 20:16, Ani Sinha (a...@arista.com) wrote: > > > > > > > Why precisely would you want to disable propagation from the root dir? > > > > The core issue is

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

2014-05-14 Thread Ani Sinha
On Wed, May 14, 2014 at 9:14 AM, Lennart Poettering wrote: > On Tue, 13.05.14 20:16, Ani Sinha (a...@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

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

2014-05-14 Thread Lennart Poettering
On Tue, 13.05.14 20:16, Ani Sinha (a...@arista.com) wrote: > The following change started mounting the rootfs as shared : > > b3ac5f8cb98757416d8660023d6564a7c411f0a0 > > The commit log and the corresponding comment in the code says that if > any setups needed the kernel default private mount, o

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

2014-05-13 Thread Ani Sinha
Note: I had sent this email earlier but I realized that I needed to be subscribed to the mailing list. Now that I have my subscription, I am resending it again. Lennart, sorry for the double noise. --- Hello folks: The following change started mounting the rootfs as shared : b3ac5f8cb98757416d