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.
This commit is contained in:
joerg 2009-04-10 16:18:04 +00:00
parent 91fe922f05
commit 760b4799c4
3 changed files with 21 additions and 5 deletions

View File

@ -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

7
etc/rc
View File

@ -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 @@ trap "echo 'Boot interrupted.'; exit 1" QUIT
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

View File

@ -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 @@ Extra arguments to the
.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