upstart as init in a chroot

Brian J. Murrell brian at interlinx.bc.ca
Sun Mar 25 15:41:05 BST 2007


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.

I can think of a couple of good reasons for being able to do this.

The first is debugging and experimenting with upstart -- writing upstart
scripts and testing them, etc.

The second is that I currently have an all-in-one server (i.e. dhcp,
samba, apache, asterisk, nfs services, etc.) that is running on mandriva
right now, and I would like to convert to ubuntu.  But with all that is
running there and the configurations, etc. it's going to be sizeable
task converting.

So I have created logical volumes on it for /, /usr, /var and mounted
them under /mnt/ubuntu and am starting the process of building the new
system in /mnt/ubuntu -- adding services and moving the configuration
from the mandriva "host".  I don't have the kind of time I need to sit
down and do everything in one sitting so I'd like to move one service at
a time to the /mnt/ubuntu chroot as I can find the time.  As each
service I move is installed into the chroot and configured I'd like to
start running it from there permanently.  Once I have done the last
service it will be time to reboot and run from the ubuntu /, /usr
and /var.

But to do all of this, really, I need to be able to run upstart, to
start the services I have moved into the chroot as I described in the
first part of this e-mail.  But it won't be pid #1 and upstart's init
process currently re-exec's itself to telinit if it's not pid #1.

Apart from this little pid #1 wrinke, doesn't this all seem like it
could work?  Doesn't it seem useful to be able to run init as a process
other than #1 for this sort of situation?

b.

-- 
My other computer is your Microsoft Windows server.

Brian J. Murrell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20070325/2bd0fcde/attachment-0001.pgp 


More information about the upstart-devel mailing list