Living on gmirror: need to reincarnate /etc/rc.early

Kostik Belousov kostikbel at gmail.com
Tue Jan 25 09:50:35 UTC 2011


On Tue, Jan 25, 2011 at 01:20:53PM +0600, Eugene Grosbein wrote:
> Hi!
> 
> In RELENG_8, gmirror is good enough to keep whole HDD pair withing the mirror.
> Its performance, stability any pretty ease of maintainance allows
> to use it widely.
> 
> With wide deployment of gmirror in production I've faced inability
> of RELENG_8 to store kernel crashdumps out-of-the-box.
> gmirror manual page documents a way to setup FreeBSD so that
> it would store crashdumps again but that way involves /etc/rc.early
> removed from RELENG_8. I've read about intentions - it was unsafe etc.
> But we still need working crashdump support.
> 
> Easiest way is to reincarnate /etc/rc.d/early support making it better and safer
> and it should support gmirror's mechanics for crashdumps out-of-the-box.
> 
> Comments?
Yes, I have this change for eons. Actually, from the moment rc.early
was booted out.

diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index 6f80b87..7981ce0 100755
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -9,7 +9,7 @@ FILES=	DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
 	ccd cleanvar cleartmp cron \
 	ddb defaultroute devd devfs dhclient \
 	dmesg dumpon \
-	encswap \
+	early encswap \
 	faith fsck ftp-proxy ftpd \
 	gbde geli geli2 gptboot gssd \
 	hastd hcsecd \
diff --git a/etc/rc.d/early b/etc/rc.d/early
new file mode 100755
index 0000000..8a863d0
--- /dev/null
+++ b/etc/rc.d/early
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: early
+# REQUIRE: disks localswap
+# BEFORE:  fsck
+
+#
+# Support for legacy /etc/rc.early script
+#
+. /etc/rc.subr
+
+name="early"
+start_cmd="early_start"
+stop_cmd=":"
+
+early_start()
+{
+	if [ -r /etc/rc.early ]; then
+		echo -n 'Executing rc.early script:'
+		. /etc/rc.early
+		echo '.'
+	fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20110125/ac1358f1/attachment.pgp


More information about the freebsd-stable mailing list