Skip to main content

Module probe

Module probe 

Source
Expand description

ProbeBackend: TCP, HTTP, sandboxed exec and free-space probes (§10 probe contract). A probe’s timeout is a deadline for the whole probe: name resolution, connection, writing and every read count against the one budget (R06). A batch runs on a bounded pool and returns by its deadline; a probe still running then is recorded Abandoned (Unknown, never Failed) and abandoned; Timeout is a probe past its own deadline. Output is data: it is truncated and logged, never interpreted as instructions.

Exec probes run under systemd-run with a dedicated dynamic user, no capabilities, NoNewPrivileges, a CPU quota, a runtime limit and, unless declared, no network.

Structs§

Probes

Constants§

BATCH_ALLOWANCE 🔒
How long past the longest probe timeout a batch waits for its stragglers.
RESOLVER 🔒
WORKERS 🔒
At most this many probes run at once.

Functions§

connect 🔒
dbus
Calls method (interface.Member, no arguments) on service at path on the system bus; any reply passes. A missing name or an error reply fails.
exec
file_present
free_space
http
http_with 🔒
io_result 🔒
left 🔒
The time left before deadline, or Timeout if none is.
parse_url
http://host[:port]/path → (host:port, host, path).
read_limit 🔒
P10: what is read is bounded by the probe’s bytes_max as well as the sandbox’s max_output, whichever is smaller.
resolve 🔒
host:port to an address within the deadline. A literal address needs no lookup; a name is resolved by resolver (getent ahosts) as a subprocess that is killed at the deadline, so a stalled resolver costs the probe its budget and no more.
run_batch_with 🔒
Run jobs on at most WORKERS threads and return by the batch deadline (the longest timeout plus allowance): a probe not finished by then, or not started, is Abandoned (§10: recorded Unknown and abandoned), and its thread is never waited for.
run_one 🔒
sandbox_argv
The systemd-run argv for an exec probe in its sandbox.
status_of
The status code from an HTTP/1.x status line.
tcp