From owner-freebsd-rc@FreeBSD.ORG Sun Feb 27 14:34:55 2005 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 521C416A4CE for ; Sun, 27 Feb 2005 14:34:55 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E442943D1F for ; Sun, 27 Feb 2005 14:34:52 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.156] (HELO rogue.smit.lan) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP id 74861433; Sun, 27 Feb 2005 17:26:54 +0300 Received: by rogue.smit.lan (Postfix, from userid 1000) id 4AE5DB88B; Sun, 27 Feb 2005 16:12:04 +0300 (EAT) Date: Sun, 27 Feb 2005 16:12:03 +0300 From: Mike Makonnen To: Brooks Davis Message-ID: <20050227131203.GA3172@rogue.smit.lan> References: <20050224221257.GA655@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20050224221257.GA655@odin.ac.hmc.edu> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/6.0-CURRENT (i386) cc: rc@freebsd.org Subject: Re: proposal: etc/rc.d/initdiskless -> /etc/rc.initdiskless 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: Sun, 27 Feb 2005 14:34:55 -0000 On Thu, Feb 24, 2005 at 02:12:57PM -0800, Brooks Davis wrote: > I would like to propose that we move the initdiskless script out of rc.d > and back into /etc. The reason for doing this is that initdiskless is > really about bootstrapping /etc from a minimial configuration. Thus > running it via rcorder is really running it too early.=20 ^^^^^^^^^ I think you mean too late, right? > By moving it to > /etc and running it directly from /etc/rc (possiably conditionally based > on the existance of /conf) we fix this issue. The main benefit of this > is that /etc/rc.d can now be modified or created entierly from entries > under /conf which could make it easier to maintain extra scripts in the > main flow of rc.d. >=20 > The change to /etc/rc would look something like: >=20 > diff -u -p -r1.335 rc > --- rc 8 Oct 2004 14:23:49 -0000 1.335 > +++ rc 24 Feb 2005 21:02:18 -0000 > @@ -50,6 +50,10 @@ HOME=3D/ > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > export HOME PATH > =20 > +if [ -d /conf ]; then > + /etc/rc.initdiskless > +fi > + This is too generic. Isn't there some way of definitely knowing whether this is a diskless boot? > . /etc/rc.subr > =20 > # Note: the system configuration files are loaded as part of >=20 >=20 > Does anyone have major objections to this change? The goal is to run > initdiskless as early as possible so /etc can be as minimal as possible > at that point. Sounds ok to me. Cheers. --=20 Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4= 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! From owner-freebsd-rc@FreeBSD.ORG Mon Feb 28 11:01:58 2005 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 BAEC816A502 for ; Mon, 28 Feb 2005 11:01:58 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9481A43D58 for ; Mon, 28 Feb 2005 11:01:58 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1SB1wYu006726 for ; Mon, 28 Feb 2005 11:01:58 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1SB1v24006720 for freebsd-rc@freebsd.org; Mon, 28 Feb 2005 11:01:57 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 28 Feb 2005 11:01:57 GMT Message-Id: <200502281101.j1SB1v24006720@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Subject: Current problem reports assigned to you 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: Mon, 28 Feb 2005 11:01:58 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- a [2004/03/09] kern/63954 rc devfs loses permissions 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2003/08/29] conf/56144 rc [PATCH] /etc/rc.d/ipmon, /etc/rc.d/ipfilt o [2004/06/30] conf/68525 rc Loader's verbose boot mode has rc.d/local o [2004/07/07] conf/68745 rc /etc/rc.d/devfs runs after ntpd so links 3 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Feb 28 15:56:30 2005 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 63E3B16A4CF for ; Mon, 28 Feb 2005 15:56:30 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13B6443D4C for ; Mon, 28 Feb 2005 15:56:30 +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 j1SFvNu6019407; Mon, 28 Feb 2005 07:57:23 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j1SFvNiw019406; Mon, 28 Feb 2005 07:57:23 -0800 Date: Mon, 28 Feb 2005 07:57:23 -0800 From: Brooks Davis To: Mike Makonnen Message-ID: <20050228155723.GA17939@odin.ac.hmc.edu> References: <20050224221257.GA655@odin.ac.hmc.edu> <20050227131203.GA3172@rogue.smit.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WIyZ46R2i8wDzkSu" Content-Disposition: inline In-Reply-To: <20050227131203.GA3172@rogue.smit.lan> 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 cc: rc@freebsd.org Subject: Re: proposal: etc/rc.d/initdiskless -> /etc/rc.initdiskless 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: Mon, 28 Feb 2005 15:56:30 -0000 --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 27, 2005 at 04:12:03PM +0300, Mike Makonnen wrote: > On Thu, Feb 24, 2005 at 02:12:57PM -0800, Brooks Davis wrote: > > I would like to propose that we move the initdiskless script out of rc.d > > and back into /etc. The reason for doing this is that initdiskless is > > really about bootstrapping /etc from a minimial configuration. Thus > > running it via rcorder is really running it too early.=20 > ^^^^^^^^^ > I think you mean too late, right? Err, yes. :-) > > By moving it to > > /etc and running it directly from /etc/rc (possiably conditionally based > > on the existance of /conf) we fix this issue. The main benefit of this > > is that /etc/rc.d can now be modified or created entierly from entries > > under /conf which could make it easier to maintain extra scripts in the > > main flow of rc.d. > >=20 > > The change to /etc/rc would look something like: > >=20 > > diff -u -p -r1.335 rc > > --- rc 8 Oct 2004 14:23:49 -0000 1.335 > > +++ rc 24 Feb 2005 21:02:18 -0000 > > @@ -50,6 +50,10 @@ HOME=3D/ > > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > > export HOME PATH > > =20 > > +if [ -d /conf ]; then > > + /etc/rc.initdiskless > > +fi > > + >=20 > This is too generic. Isn't there some way of definitely knowing > whether this is a diskless boot? Looking at initdiskless again, this check is unnecessicary because the first code in initdiskless is: dlv=3D`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` [ ${dlv:=3D0} -eq 0 ] && [ ! -f /etc/diskless ] && exit 0 There might be an argument for moving that test back in to /etc/rc to avoid including the file at all in the normal case and to make it entierly clear that initdiskless will not be run unless the syscall is set or /etc/diskless exists. > > . /etc/rc.subr > > =20 > > # Note: the system configuration files are loaded as part of > >=20 > >=20 > > Does anyone have major objections to this change? The goal is to run > > initdiskless as early as possible so /etc can be as minimal as possible > > at that point. >=20 > Sounds ok to me. Great. -- Brooks --=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 --WIyZ46R2i8wDzkSu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCIz9iXY6L6fI4GtQRAj3PAKC70pY091DZ8qrl1rlWbwRXJkdbSwCeMGaP GnQA1MvFzNVheRmbYejgHO4= =wo14 -----END PGP SIGNATURE----- --WIyZ46R2i8wDzkSu-- From owner-freebsd-rc@FreeBSD.ORG Wed Mar 2 18:59:24 2005 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 3652916A4CE for ; Wed, 2 Mar 2005 18:59:24 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id C078743D1D for ; Wed, 2 Mar 2005 18:59:23 +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 j22IxNdn019497; Wed, 2 Mar 2005 10:59:23 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j22IxNAD019495; Wed, 2 Mar 2005 10:59:23 -0800 Date: Wed, 2 Mar 2005 10:59:23 -0800 From: Brooks Davis To: Mike Makonnen Message-ID: <20050302185922.GA18031@odin.ac.hmc.edu> References: <20050224221257.GA655@odin.ac.hmc.edu> <20050227131203.GA3172@rogue.smit.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20050227131203.GA3172@rogue.smit.lan> 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 cc: rc@freebsd.org Subject: Re: proposal: etc/rc.d/initdiskless -> /etc/rc.initdiskless 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: Wed, 02 Mar 2005 18:59:24 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 27, 2005 at 04:12:03PM +0300, Mike Makonnen wrote: > On Thu, Feb 24, 2005 at 02:12:57PM -0800, Brooks Davis wrote: > > I would like to propose that we move the initdiskless script out of rc.d > > and back into /etc. The reason for doing this is that initdiskless is > > really about bootstrapping /etc from a minimial configuration. Thus > > running it via rcorder is really running it too early.=20 > ^^^^^^^^^ > I think you mean too late, right? >=20 > > By moving it to > > /etc and running it directly from /etc/rc (possiably conditionally based > > on the existance of /conf) we fix this issue. The main benefit of this > > is that /etc/rc.d can now be modified or created entierly from entries > > under /conf which could make it easier to maintain extra scripts in the > > main flow of rc.d. > >=20 > > The change to /etc/rc would look something like: > >=20 > > diff -u -p -r1.335 rc > > --- rc 8 Oct 2004 14:23:49 -0000 1.335 > > +++ rc 24 Feb 2005 21:02:18 -0000 > > @@ -50,6 +50,10 @@ HOME=3D/ > > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > > export HOME PATH > > =20 > > +if [ -d /conf ]; then > > + /etc/rc.initdiskless > > +fi > > + >=20 > This is too generic. Isn't there some way of definitely knowing > whether this is a diskless boot? >=20 > > . /etc/rc.subr > > =20 > > # Note: the system configuration files are loaded as part of > >=20 > >=20 > > Does anyone have major objections to this change? The goal is to run > > initdiskless as early as possible so /etc can be as minimal as possible > > at that point. >=20 > Sounds ok to me. Does the following patch address your concerns? I'd be having etc/rc.d/initdiskless repo-copied to /etc/rc.initdiskless and would remove etc/rc.d/preseedrandom. etc/rc.d/rcconf.sh would lose its dependency on initdiskless and become the first script to run. -- Brooks Index: 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: /usr/cvs/src/etc/rc,v retrieving revision 1.335 diff -u -p -r1.335 rc --- rc 8 Oct 2004 14:23:49 -0000 1.335 +++ rc 2 Mar 2005 17:57:29 -0000 @@ -50,6 +50,11 @@ HOME=3D/ PATH=3D/sbin:/bin:/usr/sbin:/usr/bin export HOME PATH =20 +dlv=3D`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` +if [ ${dlv:=3D0} -ne 0 -o -f /etc/diskless ]; then + /etc/rc.initdiskless +fi + . /etc/rc.subr =20 # Note: the system configuration files are loaded as part of Index: rc.d/initdiskless =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: /usr/cvs/src/etc/rc.d/initdiskless,v retrieving revision 1.41 diff -u -p -r1.41 initdiskless --- rc.d/initdiskless 12 Dec 2004 08:04:26 -0000 1.41 +++ rc.d/initdiskless 2 Mar 2005 18:20:42 -0000 @@ -124,9 +124,6 @@ # # (end of documentation, now get to the real code) =20 -dlv=3D`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` -[ ${dlv:=3D0} -eq 0 ] && [ ! -f /etc/diskless ] && exit 0 - # chkerr: # # Routine to check for error @@ -171,11 +168,16 @@ create_md() { # # set -v =20 +# We need some entropy for some commands to work, so feed the PRNG. +( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) \ + | dd of=3D/dev/random bs=3D8k 2>/dev/null + # Figure out our interface and IP. # bootp_ifc=3D"" bootp_ipa=3D"" bootp_ipbca=3D"" +dlv=3D`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` if [ ${dlv:=3D0} -ne 0 ] ; then iflist=3D`ifconfig -l` for i in ${iflist} ; do @@ -321,3 +323,9 @@ done =20 # umount partitions used to fill the memory filesystems [ -n "${to_umount}" ] && umount $to_umount + +# The entropy we fed the PRNG was low quality to mark it unseeded. +seeded=3D`sysctl -n kern.random.sys.seeded 2>/dev/null` +if [ -n "${seeded}" ]; then + sysctl kern.random.sys.seeded=3D0 2>/dev/null +fi --=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 --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCJg0KXY6L6fI4GtQRAvmjAKC2a/EuY7cF5ymo3l0oQm+hG/uljwCfZywX k9zSaXucCxYYo/LkK6vdnFM= =epRn -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0--