upstart as init in a chroot
Aidan Thornton
makosoft at googlemail.com
Tue Mar 27 00:01:44 BST 2007
On 3/26/07, Kir Kolyshkin <kir at openvz.org> wrote:
> Brian J. Murrell wrote:
> > On Sun, 2007-25-03 at 22:23 +0400, Kir Kolyshkin wrote:
> >
> >> Brian J. Murrell wrote:
> >>
> >>> I would like to run upstart's init as "init" (not re-exec'd to telinit)
> >>> in a chroot. Here's the premise... I have a chroot of feisty that I
> >>> built with debootstrap. What I'd like to do now is:
> >>>
> >>> # chroot /mnt/feisty /sbin/init
> >>>
> >>> So that the chroot environment starts and runs like a regular linux
> >>> system.
> >>>
> >>>
> >> IMHO the best way to do what you want is to use something like OpenVZ.
> >>
> >
> > No, I'm not looking for a virtualization technology.
>
> Well, it fact it's more like partitioning. You can think of OpenVZ as an
> advanced and secure chroot -- it is a very advanced chroot(), after all,
> since all the virtual environments (VEs) run under the very same, single
> kernel instance, and there is practically no performance degradation.
>
> By the way, it solves the problem of PID #1 -- inside a VE the PID of
> init is 1. It also solves a few dosen other problems which chroot() can
> not...
>
IIRC, a while back one unfortunate InitNG user discovered the hard way
that, while their chosen virtualisation solution appeared to reparent
process correctly from within the virtual server, if you looked from
outside they were actually being reparented to the host's PID 1.
Obviously, this didn't work too well, so while OpenVZ now gets it
right, users of other similar virtualisation solutions should be
careful. (UML works too, but is a bit heavyweight and slow.)
More information about the upstart-devel
mailing list