Subject: Re: /etc/rc.shutdown.local
To: None <tech-userlevel@NetBSD.org>
From: None <tlaronde@polynum.com>
List: tech-userlevel
Date: 03/17/2007 17:05:41
On Sat, Mar 17, 2007 at 02:27:39PM +0100, Joerg Sonnenberger wrote:
> 
> Placing them in /etc/rc.d is the easiest way, we can easily introduce a
> second directory though. The problem is that the boot processing needs
> to be able to read all scripts, so they have to be installed on /, the
> rest is a number of small changes to read the second directory.

It seems indeed as simple as adding a directory in /etc/rc script :

--- /etc/rc	2004-09-18 00:47:41.000000000 +0200
+++ /home/tlaronde/src/polynum/nodeconf/netbsd/etc/rc	2007-03-17 16:35:20.000000000 +0100
@@ -37,7 +37,8 @@
 
 date
 
-files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*)
+files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/* \
+	/etc/rc.local.d/*)
 
 for _rc_elem in $files; do
 	run_rc_script $_rc_elem start

And it will work as is since checkyesno will work even if name is not
set. But for consistency then, a default local conf should be sourced
too in /etc/defaults/rc.conf. What name /etc/defaults/rc.local.conf?

--- /usr/src/etc/defaults/rc.conf	2006-11-27 15:25:26.000000000 +0100
+++ /home/tlaronde/src/polynum/nodeconf/netbsd/etc/defaults/rc.conf	2007-03-17 16:42:54.000000000 +0100
@@ -341,3 +341,9 @@
 veriexec=NO
 veriexec_strict=0
 veriexec_verbose=0
+
+# Local defaults set for files in /etc/rc.local.d/
+#
+if [ -f /etc/defaults/rc.local.conf ]; then
+	. /etc/defaults/rc.local.conf
+fi

Comments?
-- 
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C