Subject: Re: Proposed rc.d/rc.conf[.d] changes....
To: None <tech-userlevel@netbsd.org>
From: Todd Vierling <tv@pobox.com>
List: tech-userlevel
Date: 05/08/2000 11:53:19
On Mon, 8 May 2000, Eduardo Horvath wrote:

: I don't want to see yet another directory of scripts that need to be kept
: in sync with the stuff in /etc/rc.d.  In addition to the maintenance issue
: is the overhead of .sourcing each one of these little scripts.

In that vein....  Why are we _forking_ all of these scripts?

In SVR4, if a rcN.d filename ends in ".sh", it is .-sourced into the main
shell instead of being run.  Though this is oft used for setting variables
in the main shell, it is also a speed hack--if the invocation is done right,
it can function almost like a regular script.

In the main rc:

. /etc/rc.subr
. /etc/rc.conf

In rc.subr, for run_rc_script:

if [ filename ends in ".sh" ]; then
	set -- start
	. $rcfile
else
	$rcfile
fi

...or similar, not in pseudocode.

-- 
-- Todd Vierling (tv@pobox.com)