fix(rc.d): supervisor-aware stop + bring clawdie.in to parity (Sam & Claude) #18
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/rc.d-stop-supervisor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #17. Two issues with the daemon(8)
-r+ child-pidfile pattern:Stop semantics (both services): with
-r, rc.subr's default stop sendsSIGTERM to the child pid — and the still-running daemon(8) supervisor
respawns it ~1s later, so
service … stopnever actually stops it. Fix:add a
-Psupervisor pidfile and a custom stop_cmd that SIGTERMs thesupervisor (which forwards to the child and exits without restarting),
waits up to 30s, SIGKILL fallback, then cleans pidfiles. Child pidfile +
unique procname are kept for accurate start/status.
clawdie.in parity: it still carried the pre-#17 pattern (
-P ${pidfile}as the only pidfile + procname="/usr/sbin/daemon"), so
service clawdie statuscould match tailscaled/colibri_daemon on a stale pidfile. Broughtit to the same shape as colibri_daemon.in: child pidfile, procname="clawdie",
supervisor pidfile, stop_cmd, socket-ready poststart, socket cleanup
poststop, and a
healthcommand.Packaging-only — no Rust touched, no rebuild needed.
sh -nclean on both;stop algorithm exercised standalone (kills supervisor, idempotent). FreeBSD
start/stop/status/restart validation still owed on OSA.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com