What happened
➜ hyp daemon stop
daemon: stopped
➜ hyp status
daemon: installed, loaded, running, state=healthy, pid=30100, mode=foreground
Both outputs are technically truthful, but together they are extremely misleading: the daemon in hyp status is a new process that launchd relaunched moments after the stop.
Why
- The installed LaunchAgent is rendered with
KeepAlive true by default (src/core/daemon/macos.js). This is deliberate per LLP 0017: the staged-restart design for config replacement requires the service manager to relaunch the daemon on exit (KeepAlive / Restart=always on Linux).
hyp daemon stop (runDaemonStop in src/core/commands/daemon.js calling requestDaemonStop in src/core/daemon/runtime.js) never talks to the service manager. It reads the PID file, sends SIGTERM, waits for the process to die, and prints daemon: stopped.
- launchd sees its KeepAlive'd process exit and restarts it within moments. Net effect: on an installed daemon,
hyp daemon stop is a restart with misleading output.
The same applies on Linux (Restart=always in the systemd user unit).
Expected
Either the daemon stays stopped, or the command tells the user it will not. runDaemonStop never checks whether a persistent service is installed, so it cannot do either today.
Possible fixes
- When a service is installed, have
hyp daemon stop stop it through the service manager (launchctl bootout gui/<uid>/<label> / systemctl --user stop) so the process stays down, and say what a later hyp daemon start will do.
- At minimum, detect the installed service and print a warning: the daemon is KeepAlive-managed and will be relaunched; suggest
hyp daemon uninstall or the bootout command for a durable stop.
Whichever way this lands, the interaction with LLP 0017's relaunch-on-exit requirement (staged restart for config replacement) needs to stay intact, so option 1 must stop supervision rather than fight it.
What happened
Both outputs are technically truthful, but together they are extremely misleading: the daemon in
hyp statusis a new process that launchd relaunched moments after the stop.Why
KeepAlivetrue by default (src/core/daemon/macos.js). This is deliberate per LLP 0017: the staged-restart design for config replacement requires the service manager to relaunch the daemon on exit (KeepAlive/Restart=alwayson Linux).hyp daemon stop(runDaemonStopinsrc/core/commands/daemon.jscallingrequestDaemonStopinsrc/core/daemon/runtime.js) never talks to the service manager. It reads the PID file, sends SIGTERM, waits for the process to die, and printsdaemon: stopped.hyp daemon stopis a restart with misleading output.The same applies on Linux (
Restart=alwaysin the systemd user unit).Expected
Either the daemon stays stopped, or the command tells the user it will not.
runDaemonStopnever checks whether a persistent service is installed, so it cannot do either today.Possible fixes
hyp daemon stopstop it through the service manager (launchctl bootout gui/<uid>/<label>/systemctl --user stop) so the process stays down, and say what a laterhyp daemon startwill do.hyp daemon uninstallor the bootout command for a durable stop.Whichever way this lands, the interaction with LLP 0017's relaunch-on-exit requirement (staged restart for config replacement) needs to stay intact, so option 1 must stop supervision rather than fight it.