Download raw body.
rcctl can't set config on non-enable services
On Thu, Mar 20, 2025 at 11:13 AM Antoine Jacoutot <ajacoutot@bsdfrog.org>
wrote:
> On Thu, Mar 20, 2025 at 11:02:28AM -0400, Sven F. wrote:
> > May be misleading but configuring before enabling
> > sounds better ( to me )
> >
> > Maybe it was trying to test for "running" instead ?
> > ( not modifying flash while running ?? )
>
> Hi.
>
> No, that's on purpose.
> If you configure a base service with non default options, it will become
> automatically enabled; we don't want that also because the pkg_scripts
> daemons
> behave differently.
> What we have now is coherent.
>
> e.g.
> # rcctl get lpd status
> # echo $?
> 1
> => that means it's NOT enabled
> # echo "lpd_flags=-b 127.0.0.1" >>/etc/rc.conf.local
> => that is what "rcctl set lpd flags -b 127.0.0.1" would do with your patch
> # rcctl get lpd status
> # echo $?
> 0
> => it's automatically enabled
>
>
> > --- /usr/sbin/rcctl.orig Thu Mar 20 15:59:58 2025
> > +++ /usr/sbin/rcctl Thu Mar 20 15:56:28 2025
> > @@ -448,9 +448,6 @@
> > else
> > rcctl_err "invalid status \"${_args}\""
> > fi
> > - else
> > - svc_get ${_svc} status || \
> > - rcctl_err "${svc} is not enabled"
> > fi
> >
> > if svc_is_special ${_svc}; then
> >
> >
>
>
Thanks for the explanation.
Would the -f be a good idea, yes settings flags enable a base daemon, but
not for packages ?
--- /usr/sbin/rcctl.orig Thu Mar 20 15:59:58 2025
+++ /usr/sbin/rcctl Thu Mar 20 18:18:16 2025
@@ -449,7 +449,7 @@
rcctl_err "invalid status \"${_args}\""
fi
else
- svc_get ${_svc} status || \
+ [ "${_RC_FORCE}" -eq "-f" ] || svc_get ${_svc} status || \
rcctl_err "${svc} is not enabled"
fi
rcctl can't set config on non-enable services