Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 13:56:24 -0500
From:      Mark Saad <nonesuch@longcount.org>
To:        stable@freebsd.org
Subject:   Re: Living on gmirror: need to reincarnate /etc/rc.early
Message-ID:  <AANLkTin0b6nOXUrePjNM8ouTK=-_n4bicKbSbDqgo0kp@mail.gmail.com>
In-Reply-To: <4D402CFA.40501@dssgmbh.de>
References:  <4D3E79D5.7050800@rdtc.ru> <4D3F24BE.1070206@FreeBSD.org> <4D402CFA.40501@dssgmbh.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 26, 2011 at 9:17 AM, Alfred Bartsch <bartsch@dssgmbh.de> wrote:
> 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. =C2=A0:)
>>
>>
>> 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):
> =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
> #!/bin/sh
>
> # PROVIDE: gmirror1
> # BEFORE: =C2=A0fsck
> # KEYWORD: nojail
>
> . /etc/rc.subr
>
> name=3D"gmirror1"
> start_cmd=3D"gmirror1_start"
> stop_cmd=3D":"
>
>
> gmirror1_start()
> {
> =C2=A0 echo "gmirror configure -b prefer gm0"
> =C2=A0 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):
> =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
> #!/bin/sh
>
> # PROVIDE: gmirror2
> # REQUIRE: DAEMON
> # BEFORE: =C2=A0LOGIN
> # KEYWORD: nojail
>
> . /etc/rc.subr
>
> name=3D"gmirror2"
> start_cmd=3D"gmirror2_start"
> stop_cmd=3D":"
>
> gmirror2_start()
> {
> =C2=A0 echo "gmirror configure -b round-robin gm0"
> =C2=A0 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
>
> _______________________________________________
> freebsd-stable@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
>

On a side note without /etc/rc.early how would someone do the following tas=
ks ?

1. On bootup relabel /dev/da2s1d to /dev/label/var where da2s1d is the
var for this box.

2. Convert  /usr from gjournal to su+j

Not each task is exactly the same from server to server do to how each
installer / admin decided to layout each disk.

As you may know you cant relabel via glabel label, tunefs -J disable,
gjournal off ..
on a disk that was mounted read / write . The old /etc/rc.early
allowed users to shoot quick scripts in there to fix systems on
a reboot, which is very useful for systems you do not have direct
console access to .
So are we supposed to make a rcng script for each task, is there
another way I am missing ?

--=20

mark saad | nonesuch@longcount.org



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