Subject: Re: Handling 3rd party rc scripts
To: None <tech-pkg@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 02/05/2002 21:27:09
[ On Wednesday, February 6, 2002 at 11:17:28 (+1100), Luke Mewburn wrote: ]
> Subject: Re: Handling 3rd party rc scripts
>
> If you want to look in other locations (e.g, /usr/local/etc/rc.d), add
> 	rc_rcorder_flags="/usr/local/etc/rc.d/*"
> 	rc_shutdown_rcorder_flags="$rc_rcorder_flags"

I don't mind $rc_rcorder_flags, but I would _really_ like to separately
define the list of any additional directories, and to explicitly do the
expansion rather than rely on the magic of someone either explicitly
listing new files, or supplying a shell filename expansion pattern.

Note carefully the additional checks in my loop:

	_all_rc_d_files=""
	for _rc_d in /etc/rc.d ${rc_more_rc_d} ; do
		if [ -d $_rc_d -a ! -h $_rc_d -a ".$(echo ${_rc_d}/*)" != ".${_rc_d}/\*" ]; then
			_all_rc_d_files="${_all_rc_d_files} $(echo ${_rc_d}/*)"
		fi
	done
	
	ordered_rc_d_files=$(rcorder ${rc_rcorder_flags} ${_all_rc_d_files})

One advantage of this is it allows /usr/pkg/etc/rc.d to be a symlink
pointing to /etc/rc.d (or even /usr/pkg/etc -> /etc) on any system where
/usr (or /usr/pkg) is not on the root filesystem.  I do use this ability
on a non-production test machine as it makes test installs much easier.


(BTW, how about my '-d' option to facilitate simple top-level debugging?  :-)

-- 
								Greg A. Woods

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