Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2012 22:17:49 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 213570 for review
Message-ID:  <201206272217.q5RMHnpY013035@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@213570?ac=10

Change 213570 by brooks@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=:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206272217.q5RMHnpY013035>