Subject: Re: etc chains...
To: netbsd-users@netbsd.org <netbsd-users@netbsd.org>
From: Jan Schaumann <jschauma@netbsd.org>
List: netbsd-users
Date: 02/05/2002 12:13:54
Julio Merino <juli@merino.net> wrote:
 
> It could be nice to have two parameters:
> 
> chain_rc="YES"
> chain_rc_dirs="/usr/pkg/etc/rc.d /usr/local/etc/rc.d"

How about this:

,----[ /etc/defaults/rc.conf ]
| # Say YES here and specify the appropriate directories if you wish to
| # start scripts that do not reside in /etc at boot
| # 
| chain_rc=NO 
| chain_rc_dirs="/etc/rc.d/"
`----

,----[ /etc/rc.conf ]
| chain_rc=YES
| chain_rc_dirs="/etc/rc.d/ /usr/pkg/etc/rc.d/"
`----

,----[ /etc/rc ]
| if ! checkyesno chain_rc; then
|         files=`rcorder -s nostart /etc/rc.d/*`
| else
|         for i in $chain_rc_dirs; do
|                 ofiles="${ofiles} $i/*"
|         done;
|         files=`rcorder -s nostart ${ofiles}`
| fi
|
| for i in $files; do
|         run_rc_script $i start
| done
`----

(Of course, this is just a quick attempt, that would require further
testing and improvement.)

-Jan

-- 
finger jschauma@netmeister.org