Subject: Re: which init? (Was Re: HEADS UP: fully dynamic linked system now the default)
To: None <current-users@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 09/30/2002 20:17:55
[ On , September 30, 2002 at 18:25:37 (-0400), William Waites wrote: ]
> Subject: Re: which init? (Was Re: HEADS UP: fully dynamic linked system now the default)
>
> >>> "Steven" == Steven M Bellovin <smb@research.att.com> writes:
> 
>     Steven> I won't have a chance to try this, but I suspect that if you made this
>     Steven> /sbin/init it would work:
> 
>     Steven> 	#!/bin/ksh
> 
>     Steven> 	exec /bin/ksh -i $* >/dev/console 2>&1 </dev/console
> 
> Except that that presupposes write  access to the root filesystem

Actually it doesn't, at least not normally.

You don't need write access to a filesystem in order to open a device
file for write.  The "real" /sbin/init opens /dev/console with O_RDRW
well before it starts /etc/rc and so well before the root filesystem can
be re-mounted read-write.

The above is only a problem if /dev/console doesn't exist on the root
filesystem and you have to use mknod to create it first.  :-)

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>