From owner-freebsd-rc@FreeBSD.ORG Mon Mar 7 15:56:46 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 1822D16A4CE for ; Mon, 7 Mar 2005 15:56:46 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA75643D2F for ; Mon, 7 Mar 2005 15:56:45 +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 j27Fuj4w026362; Mon, 7 Mar 2005 07:56:45 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j27Fujmo026361; Mon, 7 Mar 2005 07:56:45 -0800 Date: Mon, 7 Mar 2005 07:56:45 -0800 From: Brooks Davis To: Mike Makonnen Message-ID: <20050307155645.GA24571@odin.ac.hmc.edu> References: <20050224221257.GA655@odin.ac.hmc.edu> <20050227131203.GA3172@rogue.smit.lan> <20050302185922.GA18031@odin.ac.hmc.edu> <20050306083900.GA3761@rogue.smit.lan> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: <20050306083900.GA3761@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, 07 Mar 2005 15:56:46 -0000 --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 06, 2005 at 11:39:01AM +0300, Mike Makonnen wrote: > On Wed, Mar 02, 2005 at 10:59:23AM -0800, Brooks Davis wrote: > >=20 > > 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. >=20 > It all sounds ok, except for the part about removing rc.d/preseedrandom. > Can you explain why it should be removed? It may be better to add a > nostart keyword and run it manually from /etc/rc, instead moving some > of its functionality into rc.initdiskless (which is what you appear to > be doing if I'm reading the diff correctly). rc.d/preseedrandom exists for the sole purpose of making rc.d/initdiskless run. rc.d/initrandom does exactly the same thing, except that it also has access to rc.conf variables since it runs just after rcconf.sh which allows it to enable/disable hardware gatherers and to use a non-hardcoded entropy file. Actually, looking at the CVS logs for the random device, preseedrandom is entierly unnecessicary at this point because the device starts unblocked. Thus I don't need to move entropy seeding into initdiskless. At this point, just removing preseedrandom is the right thing to do since all it's accomplishing is wasting cycles on startup. -- Brooks > >=20 > > -- Brooks > >=20 > > 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 > > --=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 >=20 >=20 > 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 7C= D4 1F55 > mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon ! --=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 --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCLHm8XY6L6fI4GtQRAondAKCaKclg0gFRuJyXhE5jmSC++SXORQCeITd0 Q8Wxqi6MiZt4cXG5JRcqlUc= =qhCe -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--