Expand description
Filesystem path helpers for the daemon and its clients.
Both the daemon and the CLI-side dialer need to agree on
where the socket and state file live; isolating the logic
here means a future move (e.g. /var/run/zero/<operator>.sock
on Linux) is a single-file change instead of a grep-and-replace.
The defaults land under zero_config::runtime_paths. We
intentionally do not put the socket under XDG_RUNTIME_DIR
on Linux, because that directory is lost across login sessions
and the daemon’s whole purpose is surviving the operator’s
terminal.
Constants§
- SOCKET_
FILE_ NAME - Socket file name under the operator directory.
- STATE_
FILE_ NAME - STATE_
SUBDIR - State-file path relative to the operator directory.
state/headless.jsonkeeps daemon persistence under the same operator partition as session state and wraps.
Functions§
- default_
socket_ path - Default Unix socket path:
<zero_dir>/operators/<operator-slug>/sock. Falls back to<tmpdir>/zero-sockwhen config paths are unavailable. - default_
state_ path - Default state-file path:
<zero_dir>/operators/<operator-slug>/state/headless.json. - socket_
in - Socket path rooted at an arbitrary base — used by tests to point both the daemon and its dialer at a temp dir.
- state_
in - State-file path rooted at an arbitrary base. Mirrors the
production layout so tests exercise the same
state/headless.jsonresolution as prod.