Skip site navigation (1)Skip section navigation (2)
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

--7JfCtLOvnd9MIVvH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Please review the following changes.  They create a new keyword=20
"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=3D62882

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 ...

=2E. //depot/user/brooks/cleanup/etc/rc#7 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/initdiskless#11 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/initrandom#5 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/newsyslog#4 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/preseedrandom#4 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/rcconf.sh#3 edit
=2E. //depot/user/brooks/cleanup/etc/rc.d/resolv#7 edit

Differences ...

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc#7 (text+ko) =3D=3D=3D=3D

@@ -65,9 +65,18 @@
 	_boot=3D"start"
 fi
=20
-os=3D`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=3D"-s nostart"
 [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip=3D"$skip -s nojai=
l"
+files=3D`rcorder -k early ${skip} /etc/rc.d/* 2>/dev/null`
+
+for _rc_elem in ${files}; do
+	run_rc_script ${_rc_elem} ${_boot}
+done
+
+skip=3D"${skip} -s early"
 files=3D`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
=20
 for _rc_elem in ${files}; do

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/initdiskless#11 (text+ko)=
 =3D=3D=3D=3D

@@ -28,8 +28,7 @@
 #
 # REQUIRE: preseedrandom
 # PROVIDE: initdiskless
-# KEYWORD: nojail
-# BEFORE: ipfw
+# KEYWORD: early nojail
=20
=20
 # On entry to this script the entire system consists of a read-only root

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/initrandom#5 (text+ko) =
=3D=3D=3D=3D

@@ -4,7 +4,7 @@
 #
=20
 # PROVIDE: initrandom
-# REQUIRE: initdiskless
+# REQUIRE: rcconf
 # BEFORE: disks
 # KEYWORD: nojail
=20

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/newsyslog#4 (text+ko) =3D=
=3D=3D=3D

@@ -11,7 +11,6 @@
 . /etc/rc.subr
=20
 name=3D"newsyslog"
-rcvar=3D$name
 required_files=3D"/etc/newsyslog.conf"
 start_cmd=3D"newsyslog_start"
 stop_cmd=3D":"

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/preseedrandom#4 (text+ko)=
 =3D=3D=3D=3D

@@ -4,7 +4,7 @@
 #
=20
 # PROVIDE: preseedrandom
-# KEYWORD: nojail
+# KEYWORD: early nojail
=20
 feed_dev_random()
 {

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/rcconf.sh#3 (text+ko) =3D=
=3D=3D=3D

@@ -4,7 +4,6 @@
 #
=20
 # PROVIDE: rcconf
-# REQUIRE: initdiskless
 # BEFORE:  disks initrandom
=20
 . /etc/rc.subr

=3D=3D=3D=3D //depot/user/brooks/cleanup/etc/rc.d/resolv#7 (text+ko) =3D=3D=
=3D=3D

@@ -28,7 +28,7 @@
 #
=20
 # PROVIDE: resolv
-# REQUIRE: initdiskless rcconf
+# REQUIRE: rcconf
 # KEYWORD: nojail
=20
 . /etc/rc.subr

----- End forwarded message -----
--=20
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

--7JfCtLOvnd9MIVvH
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBZxVtXY6L6fI4GtQRAl4eAKDExoqDnnfMnfZotsbUaKiIzVpNlQCgwOZX
Kzce/KWKic+TeXmP1nAgI48=
=8VFQ
-----END PGP SIGNATURE-----

--7JfCtLOvnd9MIVvH--


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