On Wed, Feb 15, 2017 at 02:22:31PM -0200, Daniel Bolgheroni wrote:
> Hi tech@,
> 
> Setting, for example
> 
> # rcctl enable nfsd 
> # rcctl set nfsd flags -tun 4
> 
> has no effect on /etc/rc.conf.local. This is also true for other cases
> where the default flags for the daemon are equal to the flags you're
> trying to set.

That is correct (and expected).

> It seemed a problem at first, since there is no reference to this
> behaviour on the man page. But looking at the source code
> (usr.sbin/rcctl/rcctl.sh, r1.105, line 452), this is actually expected.  
> 
>                 # unset flags if they match the default enabled ones
>                 [ "${_args}" = "$(svc_getdef ${_svc} ${_var})" ] && \
>                         unset _args
> 
> Should this behaviour be on the man page? I don't think it's too obvious
> to assume the flags wasn't set on /etc/rc.conf.local because it is
> already the default for the daemon.

Well, if you enable sshd it won't add 'sshd=' to rc.conf.local either (since
it's the default).
It's kind of expected I think. That said, I don't mind to add it in the man
page if people think it's worth it.
But if you use rcctl to *set* flags, then use it to *get* them as well and you
will see it's what you expect :-)

> Having it documented or not, the diff below removes an unneeded step,
> since "-tun 4" is already the default for nfsd.

I have no opinion on that one. Sure it's not necessary but maybe it makes it
more obvious as a documentation. Dunno...

> 
> Index: faq6.html
> ===================================================================
> RCS file: /cvs/www/faq/faq6.html,v
> retrieving revision 1.427
> diff -u -p -r1.427 faq6.html
> --- faq6.html   9 Feb 2017 17:22:19 -0000       1.427
> +++ faq6.html   15 Feb 2017 16:05:30 -0000
> @@ -607,7 +607,6 @@ services must be enabled on the server:
> 
>  <blockquote><pre>
>  # <b>rcctl enable portmap mountd nfsd</b>
> -# <b>rcctl set nfsd flags -tun 4</b>
>  </pre></blockquote>
> 
>  The <tt>-t</tt> and <tt>-u</tt> flags for nfsd(8) enable TCP and UDP,
> 
> -- 
> db
> 

-- 
Antoine

Reply via email to