Hi Stuart,

On 11/20/17 10:43 AM, Stuart Henderson wrote:
> 
> There is a difference in the mechanism between daemons from packages
> (where it would be _possible_ to enable/disable independent of storing
> flags) and daemons from base (where it is not, unless changes are made
> to rc.conf - and I don't see a good way to do this without a difficult
> transition)..
> 

Probably you are right. My assumption was that the decision whether or
not a service is run is made outside of the service's rc script.

> And I don't think standard rcctl operations should work differently
> depending on whether something is in base or is a package.
> 

Agreed.

> 
> - it's simple to do what you want here really, just that you need
> to do some setup without using rcctl. all you *actually* need to do
> in this case is set openvpn_flags and dnsmasq_flags in rc.conf.local
> (note, not rc.conf) and don't list them in pkg_scripts; then just
> "rcctl start openvpn" and "rcctl stop openvpn" etc as needed.
> 

Understood. I will try.

> - do you really need to stop and start these daemons anyway? can you
> just run them even when the machine is not master?
> 

openvpn was a bad example. AFAICS openvpn in openbsd doesn't provide a
rc script. I have to run 2 instances of openvpn in parallel, anyway
(IPv4 and IPv6).

My dnsmasq answers dhcp requests and sends out router advertisements
for IPv6. I would prefer to run dnsmasq only once on the carp master and
the right interfaces.


What about the sample session I had posted? Slightly modified:

        bash-4.4# rcctl get apmd flags
        -C
        bash-4.4# rcctl set apmd status off
        bash-4.4# rcctl set apmd status on
        bash-4.4# rcctl get apmd flags
        bash-4.4#

According to the documentation this is still not what you would expect.
I understand that there is a high risk on changing the internals of
rcctl and the rc scripts, but if the code is kept as it is, then it's
necessary to mention the side effect in the documentation.


Regards
Harri

Reply via email to