From owner-freebsd-rc@FreeBSD.ORG Fri Mar 26 20:06:02 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA02C106566B; Fri, 26 Mar 2010 20:06:02 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8723A8FC15; Fri, 26 Mar 2010 20:06:02 +0000 (UTC) Received: by pwj4 with SMTP id 4so7047323pwj.13 for ; Fri, 26 Mar 2010 13:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dvTVga3iPRL+b+tP0jRrfMHP9/iVFijU535XfDKHtnE=; b=gH1NmEkJZhgYb6H+XuqP0uFr9U2xaiKMv9lyt81NmcVYTnveVXj9hFiVVpKkHSsdGR p5dbJsAiGar6tX7xWKfmuD89ybA+MDrSlVe82dGEa71BGoXbosgwHZfQTlqaIT1LFr8D jLNCDlb8mBzq5cAd+V8dD2AdxObS5mKg4djcY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ph2wYhWVlG2g85Bwoc0PxgNOnjK8redCryCaLaYquAopcuzA/quGK3VwNzTiDO0OXl LIF9w3/C7q1egGHgo/6QkzdJPoWKmIoEkXBG/8w3+GmqXkMQvH8ZTXB2HsRhuWMkvcvh cLmEb7Gux/zJL80x9u2M46auPyXS2KaKzDLpU= MIME-Version: 1.0 Received: by 10.140.127.14 with HTTP; Fri, 26 Mar 2010 13:06:01 -0700 (PDT) In-Reply-To: <201003261557.28279.jhb@freebsd.org> References: <201003261410.35830.jhb@freebsd.org> <201003261557.28279.jhb@freebsd.org> Date: Fri, 26 Mar 2010 13:06:01 -0700 Received: by 10.141.89.4 with SMTP id r4mr1560952rvl.79.1269633961954; Fri, 26 Mar 2010 13:06:01 -0700 (PDT) Message-ID: From: Xin LI To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-rc@freebsd.org Subject: Re: mountd and reload X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2010 20:06:02 -0000 On Fri, Mar 26, 2010 at 12:57 PM, John Baldwin wrote: > On Friday 26 March 2010 3:18:00 pm Xin LI wrote: >> On Fri, Mar 26, 2010 at 11:10 AM, John Baldwin wrote: >> > FYI, it would be nice if someone could fix it so that /etc/rc.d/mountd= reload >> > works when nfs_server_enable=3D"YES" is set in /etc/rc.conf but >> > mountd_enable=3D"YES" is not explicitly set. >> >> How would you think about something like this (hackish, though... =C2=A0= I >> think we should perhaps make a 'rcvars' list): >> >> Index: mountd >> =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 >> --- mountd =C2=A0 =C2=A0(revision 205651) >> +++ mountd =C2=A0 =C2=A0(working copy) >> @@ -10,7 +10,15 @@ >> =C2=A0. /etc/rc.subr >> >> =C2=A0name=3D"mountd" >> -rcvar=3D`set_rcvar` >> +if ! checkyesno mountd_enable 1>/dev/null 2>&1 ; then >> + =C2=A0 =C2=A0 if ! checkyesno nfsd_enable 1>/dev/null 2>&1; then >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rcvar=3Dnfs_server_enable >> + =C2=A0 =C2=A0 else >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rcvar=3Dnfsd_enable >> + =C2=A0 =C2=A0 fi >> +else >> + =C2=A0 =C2=A0 rcvar=3D`set_rcvar` >> +fi >> =C2=A0command=3D"/usr/sbin/${name}" >> =C2=A0pidfile=3D"/var/run/${name}.pid" >> =C2=A0required_files=3D"/etc/exports" > > Hmm, that might work. =C2=A0I think you can drop the stdio redirection fo= r > 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=3D"YES" instead of ${name}=3D"YES"?) Cheers, --=20 Xin LI http://www.delphij.net