mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-17 21:19:05 +00:00
Pulse agents derive their identity from /etc/machine-id by default. In Docker containers (especially nested in LXCs), /etc/machine-id is not guaranteed stable across container recreation: a fresh image instance gets a new machine-id, and the resulting AgentID drift causes the server to reject reports with 401 because the API token is bound to the original AgentID via the bound_agent_id token-metadata check (internal/api/router.go:1448-1458). Refs #1447. Add a --agent-id-file (and PULSE_AGENT_ID_FILE env var) flag that: 1. Reads the persisted AgentID from the file on start, when present, and short-circuits machine-id detection. The user mounts the file as a Docker volume (e.g. -v pulse-agent-id:/var/lib/pulse-agent) so it survives container recreation. 2. On first start (or when the file is missing/empty), the existing machine-id derivation runs and the resolved ID is written to the file atomically (tmp + rename, 0600 perms, parent dir created). Subsequent restarts of the container — even after `docker rm -f` and a fresh `docker run` — read the same ID from the volume and the server keeps recognising the agent. Default is no flag set, which preserves the current /etc/machine-id-derived behaviour for non-containerized installs. |
||
|---|---|---|
| .. | ||
| eval | ||
| hashpw | ||
| pulse | ||
| pulse-agent | ||
| pulse-host-agent | ||