review request: early rc.d scripts
Brooks Davis
brooks at one-eyed-alien.net
Fri Oct 8 15:32:22 PDT 2004
Please review the following changes. They create a new keyword
"early" which causes scripts to be run in a seperate rcorder evalution
before the main set of scripts. This allows initdiskless to install
more scripts in /etc/rc.d and have them executed rather then the current
confusing behavior where they are added, but not run because the list is
generated before they are added.
-- Brooks
----- Forwarded message from Brooks Davis <brooks at freebsd.org> -----
From: Brooks Davis <brooks at freebsd.org>
Date: Fri, 8 Oct 2004 22:28:13 GMT
To: Perforce Change Reviews <perforce at freebsd.org>
X-Virus-Status: No
Subject: PERFORCE change 62882 for review
http://perforce.freebsd.org/chv.cgi?CH=62882
Change 62882 by brooks at brooks_minya on 2004/10/08 22:27:26
Add an "early" keyword to preseedrandom and initdiskless. Run
those scripts before running the main set of scripts. This
allows initdiskless to install scripts in /etc/rc.d and actually
have them run.
Affected files ...
.. //depot/user/brooks/cleanup/etc/rc#7 edit
.. //depot/user/brooks/cleanup/etc/rc.d/initdiskless#11 edit
.. //depot/user/brooks/cleanup/etc/rc.d/initrandom#5 edit
.. //depot/user/brooks/cleanup/etc/rc.d/newsyslog#4 edit
.. //depot/user/brooks/cleanup/etc/rc.d/preseedrandom#4 edit
.. //depot/user/brooks/cleanup/etc/rc.d/rcconf.sh#3 edit
.. //depot/user/brooks/cleanup/etc/rc.d/resolv#7 edit
Differences ...
==== //depot/user/brooks/cleanup/etc/rc#7 (text+ko) ====
@@ -65,9 +65,18 @@
_boot="start"
fi
-os=`eval ${CMD_OSTYPE}`
+# Run a few script (primairly initdiskless) seperatly to allow
+# things to be added to /etc/rc.d before the main run.
+#
skip="-s nostart"
[ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip="$skip -s nojail"
+files=`rcorder -k early ${skip} /etc/rc.d/* 2>/dev/null`
+
+for _rc_elem in ${files}; do
+ run_rc_script ${_rc_elem} ${_boot}
+done
+
+skip="${skip} -s early"
files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
for _rc_elem in ${files}; do
==== //depot/user/brooks/cleanup/etc/rc.d/initdiskless#11 (text+ko) ====
@@ -28,8 +28,7 @@
#
# REQUIRE: preseedrandom
# PROVIDE: initdiskless
-# KEYWORD: nojail
-# BEFORE: ipfw
+# KEYWORD: early nojail
# On entry to this script the entire system consists of a read-only root
==== //depot/user/brooks/cleanup/etc/rc.d/initrandom#5 (text+ko) ====
@@ -4,7 +4,7 @@
#
# PROVIDE: initrandom
-# REQUIRE: initdiskless
+# REQUIRE: rcconf
# BEFORE: disks
# KEYWORD: nojail
==== //depot/user/brooks/cleanup/etc/rc.d/newsyslog#4 (text+ko) ====
@@ -11,7 +11,6 @@
. /etc/rc.subr
name="newsyslog"
-rcvar=$name
required_files="/etc/newsyslog.conf"
start_cmd="newsyslog_start"
stop_cmd=":"
==== //depot/user/brooks/cleanup/etc/rc.d/preseedrandom#4 (text+ko) ====
@@ -4,7 +4,7 @@
#
# PROVIDE: preseedrandom
-# KEYWORD: nojail
+# KEYWORD: early nojail
feed_dev_random()
{
==== //depot/user/brooks/cleanup/etc/rc.d/rcconf.sh#3 (text+ko) ====
@@ -4,7 +4,6 @@
#
# PROVIDE: rcconf
-# REQUIRE: initdiskless
# BEFORE: disks initrandom
. /etc/rc.subr
==== //depot/user/brooks/cleanup/etc/rc.d/resolv#7 (text+ko) ====
@@ -28,7 +28,7 @@
#
# PROVIDE: resolv
-# REQUIRE: initdiskless rcconf
+# REQUIRE: rcconf
# KEYWORD: nojail
. /etc/rc.subr
----- End forwarded message -----
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20041008/a30edb2e/attachment.bin
More information about the freebsd-rc
mailing list