diff options
author | dougb <dougb@FreeBSD.org> | 2005-12-10 20:21:46 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2005-12-10 20:21:46 +0000 |
commit | 156819c49891b3da4cc03f62d8576f19c55d26ee (patch) | |
tree | 5ded1b51d381a4c99cb73693b054a0b1d6c00a3b /etc | |
parent | 18ad8e36cd3d532baad01a00fd3b5879f273cbd5 (diff) | |
download | FreeBSD-src-156819c49891b3da4cc03f62d8576f19c55d26ee.zip FreeBSD-src-156819c49891b3da4cc03f62d8576f19c55d26ee.tar.gz |
Remove rcconf.sh from /etc/rc.d, and instead load the configuration
as part of rc. Doing this, and the sourcing of rc.subr after we have
determined if we are booting diskless (and correspondingly run
rc.initdiskless if necessary) are safe, and actually allow fewer files
to be needed on the diskless box. This also allows variables from
the configuration to be available to rc itself, such as ...
Add a variable to rc.conf, early_late_divider, which designates the
script which separates the early and late stages of the boot process.
Default this to mountcritlocal, and add text to etc/defaults/rc.conf,
rc.conf(5) and diskless(8) which describes how and why one might want
to change this.
Reviewed by: brooks
Diffstat (limited to 'etc')
-rw-r--r-- | etc/defaults/rc.conf | 5 | ||||
-rw-r--r-- | etc/rc | 20 | ||||
-rw-r--r-- | etc/rc.d/devfs | 2 | ||||
-rw-r--r-- | etc/rc.d/dumpon | 1 | ||||
-rw-r--r-- | etc/rc.d/initrandom | 1 | ||||
-rw-r--r-- | etc/rc.d/rcconf.sh | 12 | ||||
-rw-r--r-- | etc/rc.d/resolv | 1 |
7 files changed, 17 insertions, 25 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 7f851ef..ddfa971 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -24,6 +24,11 @@ rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rcshutdown_timeout="30" # Seconds to wait before terminating rc.shutdown +early_late_divider="mountcritlocal" # Script that separates early/late + # stages of the boot process. Make sure you know + # the ramifications if you change this. + # See rc.conf(5) for more details. + swapfile="NO" # Set to name of swapfile if aux swapfile desired. apm_enable="NO" # Set to YES to enable APM BIOS functions (or NO). apmd_enable="NO" # Run apmd to handle APM event from userland. @@ -50,12 +50,6 @@ HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin export HOME PATH -. /etc/rc.subr - -# Note: the system configuration files are loaded as part of -# the rc.d system (rc.d/rcconf.sh). Do not load them here as it may -# interfere with diskless booting. -# if [ "$1" = autoboot ]; then autoboot=yes _boot="faststart" @@ -70,10 +64,18 @@ if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then sh /etc/rc.initdiskless fi +# Run these after determining whether we are booting diskless in order +# to minimize the number of files that are needed on a diskless system, +# and to make the configuration file variables available to rc itself. +# +. /etc/rc.subr +echo "Loading configuration files." +load_rc_config 'XXX' + skip="-s nostart" [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip="$skip -s nojail" -# Do a first pass to get everything up to mountcritremote so that +# Do a first pass to get everything up to $early_late_divider so that # we can do a second pass that includes $local_startup directories # files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` @@ -82,7 +84,7 @@ for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} case "$_rc_elem" in - */mountcritremote) break ;; + */${early_late_divider}) break ;; esac done @@ -101,7 +103,7 @@ _skip_early=1 for _rc_elem in ${files}; do case "$_skip_early" in 1) case "$_rc_elem" in - */mountcritremote) _skip_early=0 ;; + */${early_late_divider}) _skip_early=0 ;; esac continue ;; diff --git a/etc/rc.d/devfs b/etc/rc.d/devfs index d74e988..e7a6071 100644 --- a/etc/rc.d/devfs +++ b/etc/rc.d/devfs @@ -4,7 +4,7 @@ # # PROVIDE: devfs -# REQUIRE: rcconf mountcritremote +# REQUIRE: mountcritremote # BEFORE: SERVERS securelevel # KEYWORD: nojail diff --git a/etc/rc.d/dumpon b/etc/rc.d/dumpon index 7697eab..cc049ec 100644 --- a/etc/rc.d/dumpon +++ b/etc/rc.d/dumpon @@ -4,7 +4,6 @@ # # PROVIDE: dumpon -# REQUIRE: rcconf # BEFORE: disks savecore initrandom # KEYWORD: nojail diff --git a/etc/rc.d/initrandom b/etc/rc.d/initrandom index 2c8dc52..a336cb8 100644 --- a/etc/rc.d/initrandom +++ b/etc/rc.d/initrandom @@ -4,7 +4,6 @@ # # PROVIDE: initrandom -# REQUIRE: rcconf # BEFORE: disks # KEYWORD: nojail diff --git a/etc/rc.d/rcconf.sh b/etc/rc.d/rcconf.sh deleted file mode 100644 index fdcd95b..0000000 --- a/etc/rc.d/rcconf.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: rcconf -# BEFORE: disks initrandom - -. /etc/rc.subr - -echo "Loading configuration files." -load_rc_config 'XXX' diff --git a/etc/rc.d/resolv b/etc/rc.d/resolv index d2d6371..08e775f 100644 --- a/etc/rc.d/resolv +++ b/etc/rc.d/resolv @@ -28,7 +28,6 @@ # # PROVIDE: resolv -# REQUIRE: rcconf # KEYWORD: nojail . /etc/rc.subr |