Subject: Re: PATCH: init(8) - multiuser under chroot
To: Jachym Holecek <>
From: Simon J. Gerraty <>
List: tech-userlevel
Date: 05/30/2005 12:28:38
>> background: i'd like to have the whole hard drive on my laptop
>> reside on cgd(4), including / file system.  the idea is quite simple:

I do something very similar to run the system out of a CD image.

>  * In multi-user boot, /etc/rc is run and waited for as usual.

>    If value of the "init.root" sysctl node is not equal to "/" after
>    that, /etc/rc will be run inside a chroot(2) indicated by sysctl.
>    [That is: we'll run ${init.root}/etc/rc under chroot.]

This is an interesting idea.

>  * Set up ttys as specified in ttys(5). If we did a successful chroot
>    during multi-user boot, each getty(8) process will be run in the same
>    chroot(2) path as /etc/rc did (that is, the value of ``init.root''
>    sysctl is not re-read).

Not sure I like this bit though.  Once etc/rc finishes successfully,
I make init chroot itself, keeps things nice and simple.  
As you found, going back and forth b/w single/multi-user doesn't work well
so I don't even pretend that it will work.  Boot single user or multi-user
end of story.

I haven't looked at the patch btw.