Module Name:    src
Committed By:   joerg
Date:           Fri Apr 10 16:18:04 UTC 2009

Modified Files:
        src/etc: rc
        src/etc/defaults: rc.conf
        src/share/man/man5: rc.conf.5

Log Message:
Add rc_directories to specify where to look for rc scripts.
For the moment all scripts must be in /root and non-existent directories
are skipped.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/etc/rc
cvs rdiff -u -r1.101 -r1.102 src/etc/defaults/rc.conf
cvs rdiff -u -r1.128 -r1.129 src/share/man/man5/rc.conf.5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc
diff -u src/etc/rc:1.162 src/etc/rc:1.163
--- src/etc/rc:1.162	Sat Jan  4 15:27:43 2003
+++ src/etc/rc	Fri Apr 10 16:18:04 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: rc,v 1.162 2003/01/04 15:27:43 lukem Exp $
+# $NetBSD: rc,v 1.163 2009/04/10 16:18:04 joerg Exp $
 #
 # rc --
 #	Run the scripts in /etc/rc.d with rcorder.
@@ -37,7 +37,10 @@
 
 date
 
-files=$(rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*)
+scripts=$(for rcd in ${rc_directories:-/etc/rc.d}; do
+	test -d ${rcd} && echo ${rcd}/*;
+done)
+files=$(rcorder -s nostart ${rc_rcorder_flags} ${scripts})
 
 for _rc_elem in $files; do
 	run_rc_script $_rc_elem start

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.101 src/etc/defaults/rc.conf:1.102
--- src/etc/defaults/rc.conf:1.101	Mon Mar 23 18:52:02 2009
+++ src/etc/defaults/rc.conf	Fri Apr 10 16:18:04 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.101 2009/03/23 18:52:02 hannken Exp $
+#	$NetBSD: rc.conf,v 1.102 2009/04/10 16:18:04 joerg Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -30,6 +30,10 @@
 #
 rc_rcorder_flags=""
 
+# The directories searched for rc scripts.
+# These directories must be part of the root filesystem.
+rc_directories=/etc/rc.d 
+
 # If this is set to NO, shutdown(8) will not run /etc/rc.shutdown.
 #
 do_rcshutdown=YES

Index: src/share/man/man5/rc.conf.5
diff -u src/share/man/man5/rc.conf.5:1.128 src/share/man/man5/rc.conf.5:1.129
--- src/share/man/man5/rc.conf.5:1.128	Fri Mar 27 09:11:36 2009
+++ src/share/man/man5/rc.conf.5	Fri Apr 10 16:18:04 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rc.conf.5,v 1.128 2009/03/27 09:11:36 hannken Exp $
+.\"	$NetBSD: rc.conf.5,v 1.129 2009/04/10 16:18:04 joerg Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -55,7 +55,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 27, 2009
+.Dd April 5, 2009
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -184,6 +184,15 @@
 .Xr rcorder 8
 run by
 .Pa /etc/rc .
+.It Sy rc_directories
+A string.
+Space separated list of directories searched for rc scripts.
+The default is
+.Pa /etc/rc.d .
+All directories in
+.Ev rc_directories
+must be located in the root filesystem, otherwise they will be silently
+skipped.
 .El
 .Ss Basic network configuration
 .Bl -tag -width net_interfaces

Reply via email to