Skip to main content

Module systemd

Module systemd 

Source
Expand description

systemd integration (18.20.0, #67), without libsystemd.

  • Notifications (Type=notify): ready once rws serves, reloading / ready around a reload, stopping at shutdown, status lines, and WATCHDOG=1 every half WatchdogSec while the runtime runs. Datagrams to $NOTIFY_SOCKET (a path, or @name in the abstract namespace); nothing happens without it.
  • Socket activation: listeners systemd passes (LISTEN_FDS, LISTEN_PID, LISTEN_FDNAMES) are used instead of binding: tcp and udp return a copy of the inherited socket for an address, matched by port (and kind) — systemd’s ListenStream=443 is [::]:443 while rws’s ip may say 0.0.0.0. systemd keeps the sockets across restarts, so nothing is refused while rws starts again.

Functions§

activated
Whether systemd passed any socket.
notify
Send message to $NOTIFY_SOCKET; false without one (or on error).
ready
rws serves: READY=1 (once), and the watchdog starts.
reloaded
A reload is done.
reloading
A reload starts (RELOADING=1 with the monotonic time systemd wants).
status
A status line for systemctl status.
stopping
Shutting down.
tcp
A copy of the TCP listener systemd passed for addr (or named name), if any. Each call is a new descriptor of the same socket, so several runtimes can accept on it.
udp
A copy of the UDP socket systemd passed for addr (or named name).