Documentation
¶
Overview ¶
Package unitconv holds the boot-unit convergence shared by the network planes that replay their state via a systemd oneshot. See docs/dev/traffic-shaper.md.
Index ¶
- func EnableIfDisabled(ctx context.Context, service string) error
- func EnabledAtBoot(service string) (bool, error)
- func EnsureUnit(ctx context.Context, unitPath, service string, embedded []byte) error
- func NeedsConverge(unitPath string, embedded []byte, guards []string, enabled EnabledProbe) (bool, error)
- type EnabledProbe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableIfDisabled ¶
EnableIfDisabled re-enables service if systemd would not start it at boot. Reads the same probe NeedsConverge gates on, so the two cannot disagree. Failures only warn; the drift probe reports the host again next time.
func EnabledAtBoot ¶
EnabledAtBoot reports whether systemd will start service at boot, via one Lstat rather than a DBus call. Cheap, not authoritative — see docs/dev/traffic-shaper.md.
func EnsureUnit ¶
EnsureUnit installs embedded at unitPath, daemon-reloads systemd, and enables service for boot. Write-side counterpart of NeedsConverge; a unit that is already current and enabled is a no-op, and a failed enable only warns. See docs/dev/traffic-shaper.md for why the bytes are compared, not stat-ed.
func NeedsConverge ¶
func NeedsConverge(unitPath string, embedded []byte, guards []string, enabled EnabledProbe) (bool, error)
NeedsConverge reports, read-only, whether the unit at unitPath needs writing or enabling. guards are the persisted artifacts a missing unit would replay. See docs/dev/traffic-shaper.md.
Types ¶
type EnabledProbe ¶
EnabledProbe reports whether systemd will start a unit at boot. Injectable so tests need no /etc.