Hotplug Events
The agent sends the following Hotplug events:
After the registration is successfully completed:
post-registrationAfter the registration failed:
registration-failedWhen the agent first starts after the booting process:
bootupAfter any subsequent restart:
restartAfter the configuration has been successfully applied:
config-appliedAfter the previous configuration has been restored:
config-restoredBefore services are reloaded:
pre-reloadAfter services have been reloaded:
post-reloadAfter the agent has finished its check cycle, before going to sleep:
end-of-cycle
If a hotplug event is sent by openwisp-config then all scripts existing
in /etc/hotplug.d/openwisp/ will be executed. In scripts the type of
event is visible in the variable $ACTION. For example, a script to log
the hotplug events, /etc/hotplug.d/openwisp/01_log_events, could look
like this:
#!/bin/sh
logger "openwisp-config sent a hotplug event. Action: $ACTION"
It will create log entries like this:
Wed Jun 22 06:15:17 2022 user.notice root: openwisp-config sent a hotplug event. Action: registration-failed
For more information on using these events refer to the Hotplug Events OpenWrt Documentation.