From 997405c1cadb59927aff9fe3f831061a3a60fcae Mon Sep 17 00:00:00 2001 From: dougb Date: Fri, 2 Dec 2005 20:06:07 +0000 Subject: Introduce startup scripts from the local_startup directories to the base rcorder. This is accomplished by running rcorder twice, first to get all the disks mounted (through mountcritremote), then again to include the local_startup directories. This dramatically changes the behavior of rc.d/localpkg, as all "local" scripts that have the new rc.d semantics are now run in the base rcorder, so only scripts that have not been converted yet will run in rc.d/localpkg. Make a similar change in rc.shutdown, and add some functions in rc.subr to support these changes. Bump __FreeBSD_version to reflect this change. --- etc/rc | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'etc/rc') diff --git a/etc/rc b/etc/rc index bc2e6f9..a94d923 100644 --- a/etc/rc +++ b/etc/rc @@ -53,7 +53,7 @@ export HOME PATH . /etc/rc.subr # Note: the system configuration files are loaded as part of -# the RCNG system (rc.d/rcconf.sh). Do not load them here as it may +# the rc.d system (rc.d/rcconf.sh). Do not load them here as it may # interfere with diskless booting. # if [ "$1" = autoboot ]; then @@ -72,10 +72,42 @@ fi 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 +# we can do a second pass that includes $local_startup directories +# files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} + + case "$_rc_elem" in + */mountcritremote) break ;; + esac +done + +unset files local_rc + +# Now that disks are mounted, for each dir in $local_startup +# search for init scripts that use the new rc.d semantics. +# +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` +_skip_early=1 +for _rc_elem in ${files}; do + case "$_skip_early" in + 1) case "$_rc_elem" in + */mountcritremote) _skip_early=0 ;; + esac + continue + ;; + esac + + run_rc_script ${_rc_elem} ${_boot} done echo '' -- cgit v1.1