Fwd: Re: [RFC] new initctl command

Surbhi Palande surbhi.palande at canonical.com
Fri Jun 17 08:27:36 UTC 2011

On 06/16/2011 08:13 PM, Evan Broder wrote:
> On Wed, Jun 15, 2011 at 9:47 AM, Scott James Remnant<scott at netsplit.com>  wrote:
>>   - I would say you should move /proc, /sys&  /dev over simply because
>> Upstart happens to use two of those, and it makes everyone's lives easier
> Right now this is handled (on Ubuntu at least) by init-bottom/udev,
> which means you could have a script that runs after /proc, /sys, and
> /dev are moved (using initramfs-tools' prereq hook).

The udev script moves only the devfs really. The /proc and /sys are
moved by initramfs::init itself.
> In the Ubuntu archive, at least, there are only a handful of scripts
> that even ship init-bottom hooks, but it looks like selinux might rely
> on the filesystems having moved over. Its init-bottom script does
> "chroot ${rootmnt} /sbin/load_policy -i", which seems like it probably
> requires at least one of /dev, /sys, or /proc.

Yes, you are right. The init-bottom/_load_selinux_policy script is
executed after the udev script. It does need /proc to be in the
initramfs, which it will find because the pivot command executes after
the selinux bottom script. However, what is unclear to me is whether
there this script really expects /dev to be moved on to the real rootfs
i.e is there a dependency between the selinux bottom script execution
and the /dev movement really?.

So the way the current initramfs works is:

1. init-bottom/udev
2. init-bottom/selinux
3. init moves /proc and /sys to @rootfs
4. init calls run_init @roots @init @args

We could preserve this order with the following.

1. keep the moving of the /dev as it is in the udev script
2. selinux script executes as expected.
3. pivot command executes after the init-bottom stops. upstart "pivot"
moves /sys and /proc and then executes the equivalent of run_init.

i.e - for backward compatibility, for now, keep the movement of /dev
from the initramfs to the real rootfs _as is_ in the udev script?

Warm Regards,

> Since we're preserving backwards compatibility by continuing to
> support the old-style initramfs-tools scripts directories, it seems
> like it might be best if this mechanism in particular was still
> handled by something that ran before or at the start of the
> init-bottom scripts.
> - Evan

More information about the upstart-devel mailing list