From owner-freebsd-hackers@FreeBSD.ORG Tue May 27 14:03:31 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A10837B401 for ; Tue, 27 May 2003 14:03:31 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id A579043FDD for ; Tue, 27 May 2003 14:03:30 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.9/8.12.3) with ESMTP id h4RL3SHp006397 for ; Tue, 27 May 2003 14:03:28 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.9/8.12.3/Submit) id h4RL3SH0006396 for hackers@freebsd.org; Tue, 27 May 2003 14:03:28 -0700 Date: Tue, 27 May 2003 14:03:28 -0700 From: Brooks Davis To: hackers@freebsd.org Message-ID: <20030527210328.GB30952@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Subject: doing things around rc.d/diskless X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2003 21:03:31 -0000 --xXmbgvnjoT4axfJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On some diskless 4.x systems, I've got the following patch in place to let me do things before and after rc.diskless2 does it's stuff: Index: rc.diskless2 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/Attic/rc.diskless2,v retrieving revision 1.5.2.14 diff -u -r1.5.2.14 rc.diskless2 --- rc.diskless2 23 Dec 2002 17:39:06 -0000 1.5.2.14 +++ rc.diskless2 24 May 2003 00:33:22 -0000 @@ -51,6 +51,10 @@ . /etc/rc.conf fi =20 +if [ -r /etc/rc.diskless2_pre ]; then + . /etc/rc.diskless2_pre +fi + # If we do not have a writable /var, create a memory # filesystem for /var. We don't have /usr yet so # use mkdir instead of touch to test. We want mount @@ -135,3 +139,6 @@ rm -f /tmp/dev.cpio.gz fi =20 +if [ -r /etc/rc.diskless2_post ]; then + . /etc/rc.diskless2_post +fi In practice, I use rc.diskless2_pre to do some checks to make sure the system's disk is partitioned the way I want it, fix it if it's isn't, and mount /var so diskless2 won't make a new one that "mount -a" will immedialy hide. rc.diskless2_post is used to populate /var with non-standard things. What's the right way to do this in the rc.d world? It seems like I could add more scripts which will run before and after rc.d/diskless, but I don't understand rc.d all that well. Thanks, 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 --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+09KbXY6L6fI4GtQRAt9qAKCqArC+m1vvlGNqtAGiKA0uk8TVKwCcDjBc PNye7YaYKwMqkaTM5eMUMGc= =zbEu -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE--