generated from eblume/project-template
C2(hephd-self-update): impl systemd Restart=always for clean-exit respawn
Self-restart works by exiting cleanly and letting the service manager respawn the new binary. launchd already does this (KeepAlive=true), but the systemd user unit was Restart=on-failure, which ignores a clean exit (code 0). Switch to Restart=always + RestartSec=1, update the unit test, and note in run-the-daemon that existing Linux installs must `heph daemon restart` once to regenerate the unit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
758854478b
commit
544c8bba0e
2 changed files with 13 additions and 3 deletions
|
|
@ -28,9 +28,14 @@ when it's already stopped is fine.
|
|||
`~/Library/LaunchAgents/org.hephaestus.hephd.plist`, with `RunAtLoad` +
|
||||
`KeepAlive` (starts at login, restarts if it crashes).
|
||||
- **Linux** — a **systemd user service** (`heph.service`) at
|
||||
`~/.config/systemd/user/heph.service`, with `Restart=on-failure`, enabled for
|
||||
`~/.config/systemd/user/heph.service`, with `Restart=always`, enabled for
|
||||
login.
|
||||
|
||||
> **Upgrading from an older install:** earlier units used `Restart=on-failure`,
|
||||
> which does **not** respawn after a clean exit — so opt-in self-update (which
|
||||
> exits cleanly to hand off to the new binary) wouldn't come back on Linux. Run
|
||||
> `heph daemon restart` once (it regenerates the unit) to pick up `Restart=always`.
|
||||
|
||||
Either way it runs `hephd --mode local` against the default store
|
||||
(`~/.local/share/heph/heph.db`) and socket, with logs at
|
||||
`~/.local/share/heph/hephd.log`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue