Date: Fri, 8 Oct 2004 15:32:14 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: rc@freebsd.org Subject: review request: early rc.d scripts Message-ID: <20041008223214.GA4501@odin.ac.hmc.edu>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] 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@freebsd.org> ----- From: Brooks Davis <brooks@freebsd.org> Date: Fri, 8 Oct 2004 22:28:13 GMT To: Perforce Change Reviews <perforce@freebsd.org> X-Virus-Status: No Subject: PERFORCE change 62882 for review http://perforce.freebsd.org/chv.cgi?CH=62882 Change 62882 by brooks@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 [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBZxVtXY6L6fI4GtQRAl4eAKDExoqDnnfMnfZotsbUaKiIzVpNlQCgwOZX Kzce/KWKic+TeXmP1nAgI48= =8VFQ -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041008223214.GA4501>
