Subject: Re: Not the standard rc.d complaint
To: NetBSD-current Discussion List <>
From: Andrew Gillham <>
List: current-users
Date: 04/09/2000 11:42:48
Greg A. Woods writes:
> That's one of the annoying things indeed.  Another is if your home
> directory happens to be an NFS mount and you happen to do the shutdown
> from there.  Watch out for lots of stupid messages about ignoring NFS
> errors.

If you are running a diskless NetBSD system, you can't even reboot it
cleanly under the "New Way", as NFS will completely hang. (this could
be due to my NFS server being on a different subnet, but regardless
it should "Just Work")

How about allowing /etc/rc.conf to be a single config file, or a
subdirectory containg config files? (or /etc/rc.conf and rc.config?)
Something like this could be add to the top of /etc/rc.d/*:
	if [ -d /etc/rc.conf ]; then
		. /etc/rc.conf/rwho.conf  <- or `basename $0`.conf
		. /etc/rc.conf

Then you can have /etc/rc.conf as a monolithic file _OR_ /etc/rc.conf
the config directory.
This could also be done with a different directory scheme:
	. /etc/rc.subr
	. /etc/rc.conf
	. /etc/rc.config/rwho.conf

My opinion: startup scripts in /etc/rc.d _should not_ be modified,
but _config files_ in /etc/rc.conf/whatever.conf changed to affect
the behavior.

Another proposoal:
Add all of this logic, including testing for the /etc/rc.conf/*
config file, to /etc/rc.subr.  Then each /etc/rc.d/* file would
just need '. /etc/rc.subr' to work.

Additionally, scripts could get their configuration information with
the following technique: 
enable=`find_flags $name $enabled YESNO "Do you wish to enable bind?"`
command_flags=`find_flags $name $flags ARGS "What flags should be used?"`
run_rc_command "$1" blah blah blah

Then 'find_flags' (in rc.subr) can pull in /etc/rc.conf or /etc/rc.conf/
blah.conf to find the flags for this script.  If the /etc/rc.conf/blah.conf
doesn't exist, find_flags asks the question and builds it. (depending
on an 'interactive boot' flag)
So an interactive boot would look like:
Do you wish to enable sendmail? (YES/NO) YES
What flags should be used? -bd -q30m

Andrew Gillham                            | NetBSD ist Affengeil.                     | Nachts ist es kaelter
I speak for myself, not for my employer.  | als draussen.