From owner-freebsd-stable@FreeBSD.ORG Wed Jan 26 14:35:03 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF7291065674; Wed, 26 Jan 2011 14:35:02 +0000 (UTC) (envelope-from bartsch@dssgmbh.de) Received: from mail.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id 999588FC12; Wed, 26 Jan 2011 14:35:02 +0000 (UTC) Received: from inetmail.dmz (inetmail.dmz [10.3.0.3]) by mail.incore.de (Postfix) with ESMTP id 71BD65C864; Wed, 26 Jan 2011 15:17:32 +0100 (CET) X-Virus-Scanned: amavisd-new at incore.de Received: from mail.incore.de ([10.3.0.3]) by inetmail.dmz (inetmail.dmz [10.3.0.3]) (amavisd-new, port 10024) with LMTP id vkqRua2iGD+4; Wed, 26 Jan 2011 15:17:30 +0100 (CET) Received: from mail.incore (fwintern.dmz [10.0.0.253]) by mail.incore.de (Postfix) with ESMTP id C38875C866; Wed, 26 Jan 2011 15:17:30 +0100 (CET) Received: from pcbart.incore (pcbart.incore [192.168.0.57]) by mail.incore (Postfix) with ESMTPSA id B5BFA4509C; Wed, 26 Jan 2011 15:17:30 +0100 (CET) Message-ID: <4D402CFA.40501@dssgmbh.de> Date: Wed, 26 Jan 2011 15:17:30 +0100 From: Alfred Bartsch User-Agent: Thunderbird 2.0.0.19 (X11/20090113) MIME-Version: 1.0 To: Doug Barton References: <4D3E79D5.7050800@rdtc.ru> <4D3F24BE.1070206@FreeBSD.org> In-Reply-To: <4D3F24BE.1070206@FreeBSD.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=97557F78 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org, Eugene Grosbein Subject: Re: Living on gmirror: need to reincarnate /etc/rc.early X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 14:35:03 -0000 Doug Barton schrieb: > On 01/24/2011 23:20, 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. > > I'll tell you the same thing I told Kostik way back when I removed it. > This is the only thing that anyone has ever suggested a use for in > /etc/rc.early, and the "solution" in the man page is a hack. :) > > If this is something that is necessary to do then I'd prefer to do it > properly and add an /etc/rc.d/gmirror that runs in the proper (early) > position, and then figure out the proper location in rc.d to handle the > second half of the configuration. > > I'm happy to review patches. :) > > > Doug > Hi Doug, at our site we are using the following scripts in /etc/rc.d to deal with gmirror "specials": First part (/etc/rc.d/gmirror1): ================================ #!/bin/sh # PROVIDE: gmirror1 # BEFORE: fsck # KEYWORD: nojail . /etc/rc.subr name="gmirror1" start_cmd="gmirror1_start" stop_cmd=":" gmirror1_start() { echo "gmirror configure -b prefer gm0" gmirror configure -b prefer gm0 } load_rc_config $name run_rc_command "$1" # run only if provider /dev/mirror/gm0 exists test -r /dev/mirror/gm0 || exit 0 --------------------------------- Second part (/etc/rc.d/gmirror2): ================================ #!/bin/sh # PROVIDE: gmirror2 # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: nojail . /etc/rc.subr name="gmirror2" start_cmd="gmirror2_start" stop_cmd=":" gmirror2_start() { echo "gmirror configure -b round-robin gm0" gmirror configure -b round-robin gm0 } load_rc_config $name run_rc_command "$1" # run only if provider /dev/mirror/gm0 exists test -r /dev/mirror/gm0 || exit 0 --------------------------------- In our environment, the name of the gmirror provider is always "mirror/gm0". Variable naming of the provider should be added, eventually extracted from "gmirror list" command. -- Alfred Bartsch