Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 2003 14:03:28 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        hackers@freebsd.org
Subject:   doing things around rc.d/diskless
Message-ID:  <20030527210328.GB30952@Odin.AC.HMC.Edu>

next in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030527210328.GB30952>