Subject: Re: PATCH: init(8) - multiuser under chroot
To: Alan Barrett <>
From: Jachym Holecek <>
List: tech-userlevel
Date: 05/17/2005 15:56:03
> On Sun, 15 May 2005, Jachym Holecek wrote:
> > The patch below implements this by having init(8) create and watch the
> > "init.root" sysctl node (more details follow in the init.8 part of diff):
> > 
> >   * 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.]
> OK, so we run /etc/rc twice.  The first /etc/rc, running in the real
> root filesystem, mounts the chroot filesystem, sets sysctl init.root
> to the name of the chroot directory, and exits.  Then init runs
> ${chroot}/etc/rc inside the chroot directory.

Exactly. Sorry if original description is confusing.

> >   * Due to limited interface of gettyent() and friends, we use /etc/ttys
> >     and _not_ ${chroot}/etc/ttys.
> Can we fix this by adding a way of passing an alternative file name
> to getttyent() and friends?

What about "setaltttyent(const char *path)", to be used like setttyent()?

		-- Jachym Holecek