Add ctl.sh daemon lifecycle script#1672
Conversation
88e2ebd to
7385daf
Compare
|
@Michaelyklam You and your agent are going to town on PRs, thanks again! I’d love to have you join as a regular contributor, sent you an email! most productive PR day from a single author this project has ever had! |
Initial review —
|
|
Closed by the v0.51.1 release in PR #1681 (merged at e23ba59). Massive thanks @Michaelyklam — this is now 19 merged PRs across the v0.50.292–v0.51.1 release window, an extraordinary contribution rate. Each PR was per-claim-vs-diff verified against your description and every security-relevant code path checked under independent review (Opus advisor, 6/6 questions clean). Your Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.1 🚀 |
Thinking Path
fuser/pkillplusstart.shincantations.stopmust remove stale PID files without killing unrelated processes.statusshould combine local PID state with the WebUI/healthendpoint so operators can distinguish “process exists” from “server is actually healthy”.~/.hermesstate or killing real WebUI processes.What Changed
ctl.shwith:startdaemon wrapper aroundbootstrap.py --no-browser --foregroundstopwith PID ownership checks, stale PID cleanup, SIGTERM wait, and SIGKILL fallbackrestartas stop + startstatusshowing running/stopped, PID, uptime, bound host/port, log path, and bounded/healthresultlogs --lines Nplus follow/no-follow modes~/.hermes/webui.pid,~/.hermes/webui.log, and~/.hermes/webui.ctl.envby default, with override env vars for tests/advanced use..envconventions while letting inline overrides likeHERMES_WEBUI_HOST=0.0.0.0 ./ctl.sh startwin; the wrapper also passes explicit host/port args to bootstrap so bootstrap’s own.envload cannot undo those overrides.tests/test_ctl_script.pycovering PID/log paths, foreground/no-browser launch args,.env+ inline override precedence, stale PID safety, and logs line-count behavior.Closes #591
Why It Matters
Verification
bash -n ctl.sh— passed/home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_ctl_script.py -q— 4 passedgit diff --check HEAD— passedenv -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q— attempted twice locally. The first run failed after repo-cleaning tests removed the then-uncommitted new test file; after committing the test file, the rerun still failed in this shared Kanban host with broad test-serverConnectionRefusedErrorfailures while several other full-suite WebUI workers were running concurrently. No failures were isolated to the ctl.sh targeted test after the commit.7385daf.No browser media included because this is a CLI/script/docs change and does not change the WebUI interface.
Risks / Follow-ups
hermes-webuibinary or system service installer.logsfollows by default; callers in automation should pass--no-followwhen they want a bounded command.curlbeing available; without it, status reports the health line as unknown rather than failing the command.Model Used
gpt-5.5