Sends the systemd watchdog ping (WATCHDOG=1) every half watchdog
interval, for units with WatchdogSec=.
children = [
{Sovite.Systemd.Watchdog, check: &MyApp.healthy?/0}
]The first ping is sent at start. When the watchdog is disabled (see
Sovite.Systemd.watchdog_interval/1), as outside systemd, start_link/1
returns :ignore and no process runs.
A :check function makes the ping depend on the service's health: when
it returns anything but true, or raises, that tick's ping is skipped,
and systemd restarts the service once a whole interval passes without
one. It runs in the watchdog process, so a check that hangs stops the
pings too.
Options
:check- a 0-arity function returningtruewhen the service is healthy. Defaults to none: every tick pings.:env- a map of environment variables to read instead of the OS environment, as inSovite.Systemd.:name- registered name of the process.
Telemetry
[:sovite, :systemd, :watchdog, :skipped]-%{},%{reason}: the check failed, so no ping was sent.reasonis what the check returned, or{kind, reason}when it raised, threw, or exited.
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts the watchdog, or returns :ignore when it is disabled.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the watchdog, or returns :ignore when it is disabled.