fix(caam): stop the linux daemon restart loop when caam is missing

Merged
SH
19d ago
+9-0

Summary

  • caam-daemon.service crash-loops on Linux hosts where ~/.local/bin/caam is absent: each start exits 203/EXEC and Restart=always retries every 10s.
  • ConditionPathIsExecutable does not stop this. systemd evaluates Condition* only when a start job is queued, and automatic restarts skip it. On the CI boxes the last condition check is dated 2026-10-11, and the unit has restarted about 1,670 times since then without re-checking.
  • RestartPreventExitStatus = 203 ends the loop the first time the binary is missing. A manual start or a new activation re-checks the condition.

Evidence (read-only)

  • Three Linux CI boxes: /root/.local/bin/caam does not exist and NRestarts is about 1,670. ConditionResult=yes, with ConditionTimestamp from 2026-10-11.
  • A host with the binary installed is active.

Testing

  • shellspec spec/caam_sync_service_spec.sh: 15 examples, 0 failures. The new example fails on origin/main, which has no RestartPreventExitStatus.
  • nix-instantiate --parse succeeds.

decided: RestartPreventExitStatus = 203 rather than a Darwin/Linux host split - 203 is systemd's exec-failure status, so the fix is local to the unit and keeps the daemon on hosts that do install caam.

šŸ¤– Generated with Claude Code


Summary by cubic

Stops the caam-daemon.service crash-loop on Linux hosts where the caam binary is missing. Each start previously exited with 203/EXEC and Restart=always retried every 10 seconds forever, because ConditionPathIsExecutable is only evaluated when a start job is queued, not on automatic restarts. Adding RestartPreventExitStatus = 203 ends the loop after the first failed start while keeping the restart behavior on hosts that do have the binary installed.