From owner-freebsd-rc@FreeBSD.ORG Fri Oct 8 22:32:22 2004 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5286D16A4CE for ; Fri, 8 Oct 2004 22:32:22 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 206DD43D48 for ; Fri, 8 Oct 2004 22:32:22 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i98MWEvC004932 for ; Fri, 8 Oct 2004 15:32:14 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i98MWEHh004931 for rc@freebsd.org; Fri, 8 Oct 2004 15:32:14 -0700 Date: Fri, 8 Oct 2004 15:32:14 -0700 From: Brooks Davis To: rc@freebsd.org Message-ID: <20041008223214.GA4501@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Subject: review request: early rc.d scripts X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to /etc/rc.d design and implementation. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 22:32:22 -0000 --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 ----- From: Brooks Davis Date: Fri, 8 Oct 2004 22:28:13 GMT To: Perforce Change Reviews 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--