Arguments passed to scripts in /usr/local/etc/rc.syshook.d/carp

Started by whit, October 10, 2019, 09:13:47 PM

Previous topic - Next topic
Looking at 20-openvpn there it looks like two variables are expected, where the 2nd one is either MASTER or BACKUP, presumably passed to each script in this directory just when carp switches status. The first variable gets read as "subsystem," presumably something about the identity of what triggered the carp status change. I also see
https://docs.opnsense.org/development/backend/autorun.html as reference.

Several questions then:

What are the possible (sane) subsystems for this context? Are there known problem cases to beware of here in the context of taking action, or is it generally safe to ignore this value beyond perhaps logging it?

Are scripts in carp run on initial system startup, just if the system starts up as MASTER?

Thanks!

Are there docs pertinent to this deeper functionality somewhere? Is it specific to OPNsense, or inherited from somewhere upstream?


Devd is responsible for triggering the events and arguments:

https://github.com/opnsense/core/blob/master/src/etc/devd/carp.conf

If you want to know more look at FreeBSD directly:

# man carp
# man devd


Cheers,
Franco