Phase 0 started Herdr via nohup — died on reboot / logout. Replaces
that with proper service management:
- deploy/fleet/herdr-persistence/herdr.service — systemd user unit
(Linux). Restart=on-failure with an 8-in-24h burst cap so a
broken binary doesn't hot-loop. Requires linger enabled so the
user's systemd manager runs without a login session; install.sh
does that via loginctl.
- deploy/fleet/herdr-persistence/dev.herdr.plist — launchd
LaunchAgent (macOS). ProgramArguments + PATH templated so the
install script substitutes actual paths at deploy time.
- deploy/fleet/herdr-persistence/install.sh — idempotent installer
that autodetects OS, drops the unit/plist in the right place,
enables + starts, prints status.
Rolled to tank + architect + morpheus (systemd) + smith + macbook
(launchd). All 5 nodes confirmed `status: running` post-install.
Phase 0 gap closed: Herdr now survives node reboots and logouts,
which is the prerequisite for the fleet_herdr dispatch path to be
reliable across mission_orchestrator restarts.
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
|
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<!--
|
|
Launchd user agent for Herdr's headless server. Install as:
|
|
cp dev.herdr.plist ~/Library/LaunchAgents/
|
|
launchctl load -w ~/Library/LaunchAgents/dev.herdr.plist
|
|
|
|
Reads $HOME/.local/bin/herdr — fleet_herdr and the node daemon's
|
|
PtyTarget::Command resolver both expect that path.
|
|
-->
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>dev.herdr.server</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>__HERDR_BIN__</string>
|
|
<string>server</string>
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
|
|
<key>KeepAlive</key>
|
|
<dict>
|
|
<key>SuccessfulExit</key>
|
|
<false/>
|
|
<key>Crashed</key>
|
|
<true/>
|
|
</dict>
|
|
|
|
<!-- 5 second throttle so a bad binary doesn't hot-loop. -->
|
|
<key>ThrottleInterval</key>
|
|
<integer>5</integer>
|
|
|
|
<!-- Herdr writes its own logs at ~/.config/herdr/herdr-server.log;
|
|
launchd captures anything on stdout/stderr as a safety net. -->
|
|
<key>StandardOutPath</key>
|
|
<string>/tmp/herdr-launchd.out.log</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>/tmp/herdr-launchd.err.log</string>
|
|
|
|
<!-- Herdr's install script writes to $HOME/.local/bin; make sure
|
|
the daemon's PATH includes it so the binary is resolvable. -->
|
|
<key>EnvironmentVariables</key>
|
|
<dict>
|
|
<key>PATH</key>
|
|
<string>__HOME__/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
|
|
</dict>
|
|
</dict>
|
|
</plist>
|