Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2010 13:06:01 -0700
From:      Xin LI <delphij@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: mountd and reload
Message-ID:  <a78074951003261306x6552d491h80e9a35175f157b2@mail.gmail.com>
In-Reply-To: <201003261557.28279.jhb@freebsd.org>
References:  <201003261410.35830.jhb@freebsd.org> <a78074951003261218h39d6f021u7376ee67b5d74437@mail.gmail.com> <201003261557.28279.jhb@freebsd.org>

index | next in thread | previous in thread | raw e-mail

On Fri, Mar 26, 2010 at 12:57 PM, John Baldwin <jhb@freebsd.org> wrote:
> On Friday 26 March 2010 3:18:00 pm Xin LI wrote:
>> On Fri, Mar 26, 2010 at 11:10 AM, John Baldwin <jhb@freebsd.org> wrote:
>> > FYI, it would be nice if someone could fix it so that /etc/rc.d/mountd reload
>> > works when nfs_server_enable="YES" is set in /etc/rc.conf but
>> > mountd_enable="YES" is not explicitly set.
>>
>> How would you think about something like this (hackish, though...  I
>> think we should perhaps make a 'rcvars' list):
>>
>> Index: mountd
>> ===================================================================
>> --- mountd    (revision 205651)
>> +++ mountd    (working copy)
>> @@ -10,7 +10,15 @@
>>  . /etc/rc.subr
>>
>>  name="mountd"
>> -rcvar=`set_rcvar`
>> +if ! checkyesno mountd_enable 1>/dev/null 2>&1 ; then
>> +     if ! checkyesno nfsd_enable 1>/dev/null 2>&1; then
>> +             rcvar=nfs_server_enable
>> +     else
>> +             rcvar=nfsd_enable
>> +     fi
>> +else
>> +     rcvar=`set_rcvar`
>> +fi
>>  command="/usr/sbin/${name}"
>>  pidfile="/var/run/${name}.pid"
>>  required_files="/etc/exports"
>
> Hmm, that might work.  I think you can drop the stdio redirection for
> checkyesno as other parts of this script don't do that when invoking
> checkyesno.

checkyesno would give a warning if the given variable is not being set.

I'm thinking another way of doing this, presumably cleaner (by the way
why do we use ${name}_enable="YES" instead of ${name}="YES"?)

Cheers,
-- 
Xin LI <delphij@delphij.net> http://www.delphij.net


help

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