Skip to content

Enroll a Linux host

The standalone patchtrail-host-agent reports installed packages and the booted kernel. Package inventory supports Debian, Ubuntu, and Rocky Linux 9. Use the signed release artifact for linux/amd64 or linux/arm64 from the host-agent package.

Set AGENT_VERSION to 0.1.10 or later, without the v prefix. Pull the published manifest and detached signature with ORAS.

Terminal window
oras pull "ghcr.io/patchtrail-io/host-agent:v${AGENT_VERSION}-release"

Verify release.json.sig against release.json with your trusted PatchTrail release public key. For the executable artifact that matches your architecture, pull the digest-pinned OCI reference in the verified manifest. The artifact contains patchtrail-host-agent.

  1. In the console, select your team and open Assets → Hosts → Host enrollment.
  2. Install the verified standalone executable at /usr/local/bin/patchtrail-host-agent. Check the artifact digest against the signed release metadata for its architecture.
  3. Store the team enrollment token in an owner-only file on the host. The agent exchanges it for a credential for this installation.
Terminal window
patchtrail-host-agent --enrollment-token-file /path/to/private-enrollment-token

The agent reports to https://api.patchtrail.io by default. Its persistent state directory holds the installation credential and pending reports. Reuse it across restarts to keep the same installation identity.

The host administrator installs the matching units from the verified binary. Review the journal helper before installing it.

Terminal window
patchtrail-host-agent systemd-unit patchtrail-host-journal.service
patchtrail-host-agent systemd-unit patchtrail-host-journal.socket

Systemd gives the helper the host’s existing systemd-journal group via SupplementaryGroups=systemd-journal. The uploader runs in the separate patchtrail-host-telemetry group, which gives it access to the local socket. The helper serves supported journal queries through that socket.

As a host administrator, create the local group and install the units you reviewed.

Terminal window
sudo install -d -m 0755 /etc/sysusers.d
patchtrail-host-agent systemd-unit patchtrail-host-agent.conf |
sudo tee /etc/sysusers.d/patchtrail-host-agent.conf >/dev/null
sudo systemd-sysusers /etc/sysusers.d/patchtrail-host-agent.conf
for unit in patchtrail-host-agent.service patchtrail-host-journal.service patchtrail-host-journal.socket; do
patchtrail-host-agent systemd-unit "$unit" | sudo tee "/etc/systemd/system/$unit" >/dev/null
done
sudo systemctl daemon-reload

The service uses /var/lib/patchtrail-host-agent as its persistent state directory.

For first enrollment through systemd, save the token in a root-owned file with mode 0600. Create a temporary drop-in with sudo systemctl edit --runtime patchtrail-host-agent.service. Replace the credential source path with your private token file.

[Service]
LoadCredential=patchtrail-enrollment-token:/path/to/private-enrollment-token
ExecStart=
ExecStart=/usr/local/bin/patchtrail-host-agent --state-dir ${STATE_DIRECTORY} --enrollment-token-file %d/patchtrail-enrollment-token

Enable and start the agent with sudo systemctl enable --now patchtrail-host-agent.service. Once the host reports its first observation, remove the token file and the enrollment drop-in, reload systemd, and restart the agent. Check that the same host reports again.

For signed automatic updates, install a separate root-owned copy of the binary at /usr/local/libexec/patchtrail-host-updater and the matching patchtrail-host-update.service and patchtrail-host-update.timer units. The updater verifies the release and executable, confirms a healthy startup, and restores the previous executable if startup fails.

Open the host in Hosts and look for a current observation. Check the distro release, package versions, and booted kernel. A fixed kernel that has been installed but is still awaiting a reboot remains an exposure until a fresh observation confirms the fixed kernel is running. See Verify a fix.