From owner-freebsd-rc@FreeBSD.ORG Sun Mar 6 08:39:06 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 415B716A4CE for ; Sun, 6 Mar 2005 08:39:06 +0000 (GMT) Received: from telecom.net.et (sparrow.telecom.net.et [213.55.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0295243D2D for ; Sun, 6 Mar 2005 08:39:03 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.68.123] (HELO rogue.smit.lan) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP id 75522805; Sun, 06 Mar 2005 11:31:05 +0300 Received: by rogue.smit.lan (Postfix, from userid 1000) id 44AE8B81A; Sun, 6 Mar 2005 11:39:01 +0300 (EAT) Date: Sun, 6 Mar 2005 11:39:01 +0300 From: Mike Makonnen To: Brooks Davis Message-ID: <20050306083900.GA3761@rogue.smit.lan> References: <20050224221257.GA655@odin.ac.hmc.edu> <20050227131203.GA3172@rogue.smit.lan> <20050302185922.GA18031@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050302185922.GA18031@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, 06 Mar 2005 08:39:06 -0000 On Wed, Mar 02, 2005 at 10:59:23AM -0800, Brooks Davis wrote: > > 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. 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). > > -- Brooks > > Index: rc > =================================================================== > 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=/ > PATH=/sbin:/bin:/usr/sbin:/usr/bin > export HOME PATH > > +dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` > +if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then > + /etc/rc.initdiskless > +fi > + > . /etc/rc.subr > > # Note: the system configuration files are loaded as part of > Index: rc.d/initdiskless > =================================================================== > 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) > > -dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` > -[ ${dlv:=0} -eq 0 ] && [ ! -f /etc/diskless ] && exit 0 > - > # chkerr: > # > # Routine to check for error > @@ -171,11 +168,16 @@ create_md() { > # > # set -v > > +# 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=/dev/random bs=8k 2>/dev/null > + > # Figure out our interface and IP. > # > bootp_ifc="" > bootp_ipa="" > bootp_ipbca="" > +dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` > if [ ${dlv:=0} -ne 0 ] ; then > iflist=`ifconfig -l` > for i in ${iflist} ; do > @@ -321,3 +323,9 @@ done > > # 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=`sysctl -n kern.random.sys.seeded 2>/dev/null` > +if [ -n "${seeded}" ]; then > + sysctl kern.random.sys.seeded=0 2>/dev/null > +fi > > -- > 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 Cheers. -- 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 !