Documentation
¶
Overview ¶
Package service installs the agent as a background service, on whichever init system the host actually has.
The agent has to keep running rather than fire once, because Solve needs it to be there when a fix is approved — a daily timer cannot answer a click. And it has to work on hosts older than systemd, because the neglected servers our users inherited are exactly those hosts.
Nothing outside this package knows which init system is in use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind is the init system this host uses.
func Detect ¶
func Detect() Kind
Detect reports which init system is running here.
It reads /proc/1/comm rather than testing for /run/systemd/system, matching the detection already used by the services collector. That check is the honest one: /run/systemd/system exists in places systemd is not actually running pid 1, and two detectors that disagree is a bug waiting for a customer to find.
type Spec ¶
Spec is what any init system needs to be told about the agent.
Env carries KEY=value settings the running service needs. It exists because the agent registers against one address and would otherwise report to another: the address is known at install time and forgotten by the time the service starts, unless the init system is told to pass it on.