Skip to main content

Module systemd_killmode

Module systemd_killmode 

Source
Expand description

systemd KillMode=control-group detection (#391, part of #354).

When the daemon runs inside a systemd unit whose KillMode is control-group (systemd’s default), stopping the unit kills every process in the unit’s cgroup — including spawned children the daemon expected to outlive it. At startup the daemon probes for this and emits a WARN; broker doctor surfaces the same assessment.

The decision logic (assess) is a pure function over SystemdProbeInputs so it is testable on every platform with simulated environments. Only probe’s input gathering is Linux-specific; on other platforms it reports KillModeAssessment::NotSystemd.

Structs§

SystemdProbeInputs
Inputs to the KillMode assessment, gathered by probe or injected by tests.

Enums§

KillModeAssessment
Result of the KillMode assessment.

Functions§

assess
Pure KillMode assessment over injected inputs.
parse_kill_mode
Extract the KillMode value from systemctl show -p KillMode <unit> output (KillMode=control-group), tolerating a bare --value form.
probe
Probe the live environment. Linux-only gathering; other platforms always report KillModeAssessment::NotSystemd.
unit_from_cgroup
Resolve the owning systemd unit name from /proc/self/cgroup contents.