From owner-cvs-all Sun Dec 22 10:48:40 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1530137B415 for ; Sun, 22 Dec 2002 10:48:36 -0800 (PST) Received: from mail.identd.net (matrix.identd.net [64.172.21.201]) by mx1.FreeBSD.org (Postfix) with SMTP id 2662043EE8 for ; Sun, 22 Dec 2002 10:48:35 -0800 (PST) (envelope-from mtm@identd.net) Received: (qmail 32732 invoked by uid 1007); 22 Dec 2002 18:48:34 -0000 Date: Sun, 22 Dec 2002 10:48:34 -0800 From: Mike Makonnen , Mike Makonnen To: Matthew Dillon Cc: jake@locore.ca, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/etc rc.diskless1 Message-ID: <20021222134047.51723c7c.mtm@identd.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l76fUT7nc3MelDdI" Content-Disposition: inline In-Reply-To: <200212212038.gBLKcFUY075250@apollo.backplane.com> User-Agent: Mutt/1.4i X-Mailer: Sylpheed version 0.8.6 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --l76fUT7nc3MelDdI Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, 21 Dec 2002 12:38:15 -0800 (PST) Matthew Dillon wrote: >=20 > This creates massive leakage from the server's own rc.conf's into the > diskless client's rc.conf's. >=20 > In order to fix the problem we cannot unconditionally load_rc_config > in /etc/rc. Instead, load_rc_config must itself be a dependancy in > rc.d. I have included the adjustments below for review. Basically > I add rc.d/rcconf which depends on initdiskless, then any other > rc files with no REQUIRE lines depend on rcconf. >=20 Please try the following patch. Usually you can avoid touching many files by judicious use of the BEFORE line. Also, it creates rcconf.sh because by default scripts are executed in a subshell (so they don't pollute the environment for the rest of the scripts). If you _do_ want it to affect oth= er scripts environments the script must have a .sh suffix. Cheers. --=20 Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC= 68B9 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diskless.diff" Content-Transfer-Encoding: quoted-printable Index: etc/rc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/etc/rc,v retrieving revision 1.324 diff -u -r1.324 rc --- etc/rc 18 Dec 2002 07:21:30 -0000 1.324 +++ etc/rc 22 Dec 2002 18:02:28 -0000 @@ -69,11 +69,6 @@ [Yy][Ee][Ss]) . /etc/rc.subr =20 - # Load system configuration files. The 'XXX' is there because - # the function requires an argument that we don't need to use. - # - load_rc_config 'XXX' - if [ "$1" =3D autoboot ]; then autoboot=3Dyes _boot=3D"faststart" @@ -88,13 +83,6 @@ =20 for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} - # Local FreeBSD hack to reload the rc.conf on - # a return status of 2 - if [ $? -eq 2 ]; then - unset _rc_conf_loaded - load_rc_config 'XXX' - echo "Reloading rc.conf." - fi done =20 echo '' Index: etc/rc.d/devd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/etc/rc.d/devd,v retrieving revision 1.2 diff -u -r1.2 devd --- etc/rc.d/devd 30 Nov 2002 00:40:53 -0000 1.2 +++ etc/rc.d/devd 22 Dec 2002 18:10:57 -0000 @@ -4,6 +4,7 @@ # =20 # PROVIDE: devd +# REQUIRE: rcconf # BEFORE: disks # KEYWORD: FreeBSD =20 Index: etc/rc.d/rcconf.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: etc/rc.d/rcconf.sh diff -N etc/rc.d/rcconf.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ etc/rc.d/rcconf.sh 22 Dec 2002 18:24:11 -0000 @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: rcconf +# REQUIRE: initdiskless +# BEFORE: disks initrandom +# KEYWORD: FreeBSD + +echo 'Loading configuration files.' +load_rc_config 'XXX' --Q68bSM7Ycu6FN28Q-- --l76fUT7nc3MelDdI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+BgkA2uHir9vMaLkRAkevAJ41bi81TPmL8AdP1EX/JscPfJJDywCfZcLh Vu9f5kVrfrpGbSxvfW8/Lns= =cofR -----END PGP SIGNATURE----- --l76fUT7nc3MelDdI-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message