Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: mountd and reload

3 views
Skip to first unread message

Doug Barton

unread,
Mar 26, 2010, 3:14:08 PM3/26/10
to freeb...@freebsd.org
On 03/26/10 11:10, 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="YES" is set in /etc/rc.conf but
> mountd_enable="YES" is not explicitly set.

You want to do onereload there, at least that should work.


hth,

Doug

--

... and that's just a little bit of history repeating.
-- Propellerheads

Improve the effectiveness of your Internet presence with
a domain name makeover! http://SupersetSolutions.com/

John Baldwin

unread,
Mar 26, 2010, 2:10:35 PM3/26/10
to freeb...@freebsd.org
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.

--
John Baldwin

Xin LI

unread,
Mar 26, 2010, 3:18:00 PM3/26/10
to John Baldwin, freeb...@freebsd.org

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"

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

John Baldwin

unread,
Mar 26, 2010, 3:57:28 PM3/26/10
to Xin LI, freeb...@freebsd.org

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.

--
John Baldwin

Xin LI

unread,
Mar 26, 2010, 4:06:01 PM3/26/10
to John Baldwin, freeb...@freebsd.org

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"?)

Doug Barton

unread,
Mar 27, 2010, 4:18:02 PM3/27/10
to Xin LI, freeb...@freebsd.org, John Baldwin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On 03/26/10 12:18, Xin LI wrote:
> On Fri, Mar 26, 2010 at 11:10 AM, John Baldwin <j...@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):

I am opposed to it. We already have a mechanism for starting things that
don't have _enable set.

OTOH I agree that there is a more general problem that our rc.d system
should be smarter about what dependent services need to be enabled for a
given service but that problem should be solved generally. One-off hacks
like this will create a lot of drama and confusion that I would really
prefer to avoid.


Doug


> 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"
>
> Cheers,

- --

... and that's just a little bit of history repeating.
-- Propellerheads

Improve the effectiveness of your Internet presence with
a domain name makeover! http://SupersetSolutions.com/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEAREDAAYFAkuuZ/oACgkQyIakK9Wy8Pt17ACeJUdrNgHDeJmaKw70LGPhPA1D
VVEAn2Fv8i5DX+tO2hvBNnT/0Gn08UFi
=qfVe
-----END PGP SIGNATURE-----

John Baldwin

unread,
Mar 29, 2010, 12:03:18 PM3/29/10
to Doug Barton, freeb...@freebsd.org, Xin LI
On Saturday 27 March 2010 4:18:02 pm Doug Barton wrote:
> On 03/26/10 12:18, Xin LI wrote:
> > On Fri, Mar 26, 2010 at 11:10 AM, John Baldwin <j...@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):
>
> I am opposed to it. We already have a mechanism for starting things that
> don't have _enable set.
>
> OTOH I agree that there is a more general problem that our rc.d system
> should be smarter about what dependent services need to be enabled for a
> given service but that problem should be solved generally. One-off hacks
> like this will create a lot of drama and confusion that I would really
> prefer to avoid.

Can we come up with some sort of solution please? Right now 'sh
/etc/rc.d/mountd reload' is useless for the common case.

--
John Baldwin

Doug Barton

unread,
Mar 29, 2010, 1:29:49 PM3/29/10
to John Baldwin, freeb...@freebsd.org, Xin LI
On 03/29/10 09:03, John Baldwin wrote:
> Can we come up with some sort of solution please? Right now 'sh
> /etc/rc.d/mountd reload' is useless for the common case.

The common case is to enable things in rc.conf that you want to start.
The next most common case is to use onereload for one-offs. Did you try
that as I suggested a few days ago?


Doug

John Baldwin

unread,
Mar 29, 2010, 2:33:55 PM3/29/10
to Doug Barton, freeb...@freebsd.org, Xin LI
On Monday 29 March 2010 1:29:49 pm Doug Barton wrote:
> On 03/29/10 09:03, John Baldwin wrote:
> > Can we come up with some sort of solution please? Right now 'sh
> > /etc/rc.d/mountd reload' is useless for the common case.
>
> The common case is to enable things in rc.conf that you want to start.
> The next most common case is to use onereload for one-offs. Did you try
> that as I suggested a few days ago?

We used forcereload, but that isn't really intuitive to a user, esp. given
that mountd is implicitly started, but issuing a reload just silently
fails. If the reload attempt whined, or if rc.d was smarter about implicit
dependencies so that it would see that mountd was implicitly started and
thus implicitly enable reload, either of those would be a vast improvement
over the current system.

--
John Baldwin

Xin LI

unread,
Mar 29, 2010, 3:03:05 PM3/29/10
to John Baldwin, Doug Barton, freeb...@freebsd.org
What about this one...

(rc.subr in checkyesno would accept a list of variables and return 0
if any of them was set to "YES", and 1 if none of them was set or,
when there is at least one "NO" and no "YES" set).

rc.diff

Xin LI

unread,
Mar 29, 2010, 3:20:44 PM3/29/10
to freeb...@freebsd.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2010/03/27 13:18, Doug Barton wrote:
> On 03/26/10 12:18, Xin LI wrote:
>> On Fri, Mar 26, 2010 at 11:10 AM, John Baldwin <j...@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):
>
> I am opposed to it. We already have a mechanism for starting things that
> don't have _enable set.
>
> OTOH I agree that there is a more general problem that our rc.d system
> should be smarter about what dependent services need to be enabled for a
> given service but that problem should be solved generally. One-off hacks
> like this will create a lot of drama and confusion that I would really
> prefer to avoid.

I think what we really want is to explicitly say, e.g. nfsd_enable is
considered the same as if mountd_enable set to "YES" regardless whether
we got a "NO" from the default rc.conf.

e.g. in the past we do:

- in nfsd script:
if enabled="YES" then forcestart mountd

Now we do:

- in nfsd script: start when nfsd_enable="YES"
- in mountd script: start when either mountd_enable="YES" or
nfsd_enabled="YES"

And, make sure that these scripts are properly ordered when necessary.

Cheers,
- --
Xin LI <del...@delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJLsP2MAAoJEATO+BI/yjfB4oIH/i3RSGWbKilSs4cvlFELVy8R
eWE/6j2OOGzKLACC0kpoHx41AMNSiA9+4VN/P9QjSsLzsMBprXn/r057SrFr4eza
WO4lbmfTYuuQlF4XP+UNQfaQ1t7LXsjlvqpilfd51CJUuxZgVVfuEx5UhG4kJviO
HrgBo7yvhsRozU/7ncCyQhtCzA9bliJ44OzOf+5R0tYn43ochVnIDrL/e4qz19Jy
f2W/lMVgU1HYdsAoKvVKPchPPNir/PVOeqKLdwgSM9rb8P53itFFgl4hh31etFxA
wG4j9qG1meo5jjfLCpouOfVKgI4giweHQLDfqFt3rHw6HFs35l6qPcCMh1xPLok=
=+eVS
-----END PGP SIGNATURE-----

Xin LI

unread,
Mar 31, 2010, 8:47:22 PM3/31/10
to Xin LI, Doug Barton, freeb...@freebsd.org, John Baldwin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2010/03/29 12:03, Xin LI wrote:
> What about this one...
>
> (rc.subr in checkyesno would accept a list of variables and return 0
> if any of them was set to "YES", and 1 if none of them was set or,
> when there is at least one "NO" and no "YES" set).

Doug: Ping? :)

Cheers,
- --
Xin LI <del...@delphij.net> http://www.delphij.net/
FreeBSD - The Power to Serve! Live free or die
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iQEcBAEBAgAGBQJLs+0aAAoJEATO+BI/yjfBIXMIALRmcmYLxbosyD8yehOCW+Tu
KudGFDsKppIsBvvyFQKthaWS/qqmSJl6P5goxNDrZhBD0OL2SNKzsZRO/JmjXQMy
a5lU3xFkhUEiywy1ofsfLJ1QZyH/ZfyITZH58LA9inbsLCSxGawSgQ36S+wxSlUg
9x8QSa26kdIqG40XszDxeiUR2/bFaFdltIHt5x5SKjOV3+uLZTixl1iyREO41lVy
Cqxg0VhcOV6gAn+553yqGgalVm/oWX5uGS7b0FZ1YVlAuakZxTh+WExwvZaVhJWA
IVN7m2t3ncsUcfmFezn60L29IF4SBza6CgjZ80z7Qoj57ZotITi4AQ6MqS6IZ7Y=
=mXby
-----END PGP SIGNATURE-----

0 new messages