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