Skip to main content

Module systemd_watchdog

Module systemd_watchdog 

Source
Expand description

Runtime-liveness heartbeat for the systemd service watchdog.

When the unit sets WatchdogSec=, systemd passes WATCHDOG_USEC and NOTIFY_SOCKET to the daemon and restarts it if no WATCHDOG=1 arrives within that period. The heartbeat is a task on the tokio runtime, so it proves that a runtime worker is free to run work, not only that the process exists. A task that holds every worker without awaiting stops the heartbeat, and systemd then restarts the node instead of reporting it active while it serves nothing.

The node has no setting for this. The unit’s WatchdogSec= turns it on and sets the period. Without WATCHDOG_USEC the heartbeat does not start.

Structs§

Heartbeat
Where to send the heartbeat, and how often.
Notifier
A datagram socket bound to the NOTIFY_SOCKET address, built once and reused for every heartbeat.

Functions§

spawn
Start the heartbeat on the current tokio runtime when systemd asks for one.