OPNsense Forum

Archive => 19.7 Legacy Series => Topic started by: whit on October 10, 2019, 09:13:47 pm

Title: Arguments passed to scripts in /usr/local/etc/rc.syshook.d/carp
Post by: whit on October 10, 2019, 09:13:47 pm
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!
Title: Re: Arguments passed to scripts in /usr/local/etc/rc.syshook.d/carp
Post by: whit on October 15, 2019, 10:44:16 pm
Are there docs pertinent to this deeper functionality somewhere? Is it specific to OPNsense, or inherited from somewhere upstream?
Title: Re: Arguments passed to scripts in /usr/local/etc/rc.syshook.d/carp
Post by: whit on October 15, 2019, 10:54:31 pm
Then here I'm seeing a suggestion that the existing "openvpn" file there is misnamed:

https://www.bountysource.com/issues/65768122-carp-events-notifications-can-be-in-separate-file

What direction is this going now?
Title: Re: Arguments passed to scripts in /usr/local/etc/rc.syshook.d/carp
Post by: franco on October 29, 2019, 01:48:39 pm
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