[lxc-devel] Why pivot_root()?

Ludovic Guégan ludovic.guegan at gmail.com
Mon Apr 25 08:58:26 UTC 2011


Hi Rob,

It was discussed here:
http://www.redhat.com/archives/libvir-list/2009-April/msg00116.html

Ludo

On Sun, Apr 24, 2011 at 6:46 AM, Rob Landley <rlandley at parallels.com> wrote:

> I'm reading through the LXC code and for some reason it's using
> pivot_root() instead of chroot().  Is there a reason for this?  (We need
> to iterate through every process in the system and make sure that kernel
> threads that are the children of the host's PID 1 get evicted from the
> old mount point so we can umount it?  But the host context isn't going
> away when we launch a container...)
>
> I thought that syscall was created to dispose of initrd so the system
> could free the ramdisk block device without the kernel threads that were
> reparented to init pinning the mount point, and one of the big
> advantages of initramfs is it _didn't_ need to call that particular
> piece of black magic (because initramfs provides a low-overhead place to
> park daemonized kernel threads).
>
> What's the advantage of using it here?
>
> Rob
>
>
> ------------------------------------------------------------------------------
> Fulfilling the Lean Software Promise
> Lean software platforms are now widely adopted and the benefits have been
> demonstrated beyond question. Learn why your peers are replacing JEE
> containers with lightweight application servers - and what you can gain
> from the move. http://p.sf.net/sfu/vmware-sfemails
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20110425/0808636c/attachment.html>


More information about the lxc-devel mailing list