PERFORCE change 213570 for review

Brooks Davis brooks at FreeBSD.org
Wed Jun 27 22:17:51 UTC 2012


http://p4web.freebsd.org/@@213570?ac=10

Change 213570 by brooks at brooks_ecr_current on 2012/06/27 22:16:46

	Add support for an optional /etc/rcorder.startup file that
	contains a hardcoded ordering of scripts.  It is intended
	to allow scripts to be run in their normal order after many
	scripts have been pruned from an image.
	
	This works around incomplete specification of dependencies which
	results in things like initrandom running very late (after sshd)
	in a minimal environment.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/etc/rc#2 edit
.. //depot/projects/ctsrd/beribsd/src/etc/rc.subr#3 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/etc/rc#2 (text+ko) ====

@@ -82,7 +82,11 @@
 # 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`
+if [ -r /etc/rcorder.start ]; then
+	files=`read_fixed_rcorder /etc/rcorder.start`
+else
+	files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
+fi
 
 _rc_elem_done=' '
 for _rc_elem in ${files}; do
@@ -104,7 +108,11 @@
 *)	find_local_scripts_new ;;
 esac
 
-files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`
+if [ -r /etc/rcorder.start ]; then
+	files=`read_fixed_rcorder /etc/rcorder.start`
+else
+	files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`
+fi
 for _rc_elem in ${files}; do
 	case "$_rc_elem_done" in
 	*" $_rc_elem "*)	continue ;;

==== //depot/projects/ctsrd/beribsd/src/etc/rc.subr#3 (text+ko) ====

@@ -1738,6 +1738,20 @@
 	esac
 }
 
+read_fixed_rcorder()
+{
+	local _files _file
+
+	_files=""
+	while read _file; do
+		if [ -r ${_file} ]; then
+			_files="${_files} ${_file}"
+		fi
+	done < $1
+
+	echo ${_files}
+}
+
 fi # [ -z "${_rc_subr_loaded}" ]
 
 _rc_subr_loaded=:


More information about the p4-projects mailing list