AptLarder::SystemD
Thin wrapper around the systemd sd_notify(3) protocol.
Sends newline-delimited state strings to the socket named by
$NOTIFY_SOCKET. All methods are no-ops when the variable is unset
(i.e. when not managed by systemd).
A single UNIXSocket is opened on first use and reused for all
subsequent notifications, avoiding repeated open/close syscalls on
the watchdog keepalive path.
Service file
[Service]
Type=notify
NotifyAccess=main
WatchdogSec=30
ExecStart=/usr/bin/apt-larder server --config /etc/apt-larder.yml
Constants
Class methods
Spawns a fiber that sends WATCHDOG=1 at half the watchdog interval.
Does nothing when the watchdog is not configured.
Sends STATUS=<message> — a human-readable status line shown by
systemctl status.
Sends STOPPING=1 — signals that the service has received a shutdown
request and is draining in-flight requests.
Sends WATCHDOG=1 — resets the watchdog timer.
Call at most every watchdog_usec / 2 microseconds.
Returns the watchdog interval from $WATCHDOG_USEC, or nil if the
watchdog is not configured.