hermes-agent/hermes_cli
d 🔹 ee5daba061 fix: resolve systemd restart loop with --replace flag (#576)
When running under systemd, the gateway could enter restart loops in two
scenarios:

1. The previous gateway process hasn't fully exited when systemd starts
   a new one, causing 'Gateway already running (PID ...)' → exit 1 →
   restart → same error → infinite loop.

2. The interactive CLI exits immediately in non-TTY mode, and systemd
   keeps restarting it.

Changes:

- Add --replace flag to 'hermes gateway run' that gracefully kills any
  existing gateway instance (SIGTERM → wait 10s → SIGKILL) before
  starting, preventing the PID-lock deadlock.

- Update the generated systemd unit template to use --replace by default,
  add ExecStop for clean shutdown, set KillMode=mixed and
  TimeoutStopSec=15 for proper process management.

- Existing behavior (without --replace) is unchanged: still prints the
  error message and exits, now also mentioning the --replace option.

Fixes #576
2026-03-07 18:08:12 +00:00
..
__init__.py Hermes Agent UX Improvements 2026-02-22 02:16:11 -08:00
auth.py feat: implement Z.AI endpoint detection for API key validation 2026-03-07 09:43:37 -08:00
banner.py feat: show update-available notice in CLI banner 2026-03-07 07:35:36 -08:00
callbacks.py refactor: reorganize agent and CLI structure for improved clarity 2026-02-21 23:17:18 -08:00
clipboard.py fix: clipboard image paste on WSL2, Wayland, and VSCode terminal 2026-03-05 20:22:44 -08:00
codex_models.py refactor(auth): transition Codex OAuth tokens to Hermes auth store 2026-03-01 19:59:24 -08:00
colors.py Cleanup time! 2026-02-20 23:23:32 -08:00
commands.py feat: add /insights command with usage analytics and cost estimation 2026-03-06 14:04:59 -08:00
config.py fix: update setup/config UI for local browser mode 2026-03-07 01:23:27 -08:00
cron.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
doctor.py feat: add z.ai/GLM, Kimi/Moonshot, MiniMax as first-class providers 2026-03-06 18:55:18 -08:00
gateway.py fix: resolve systemd restart loop with --replace flag (#576) 2026-03-07 18:08:12 +00:00
main.py fix: resolve systemd restart loop with --replace flag (#576) 2026-03-07 18:08:12 +00:00
models.py chore: update OpenRouter model list 2026-03-06 00:52:45 -08:00
pairing.py Cleanup time! 2026-02-20 23:23:32 -08:00
runtime_provider.py feat: add z.ai/GLM, Kimi/Moonshot, MiniMax as first-class providers 2026-03-06 18:55:18 -08:00
setup.py feat: implement Z.AI endpoint detection for API key validation 2026-03-07 09:43:37 -08:00
skills_hub.py fix: review fixes — path traversal guard, trust_style consistency, edge cases 2026-03-06 01:40:01 -08:00
status.py fix: update setup/config UI for local browser mode 2026-03-07 01:23:27 -08:00
tools_config.py fix: update setup/config UI for local browser mode 2026-03-07 01:23:27 -08:00
uninstall.py Cleanup time! 2026-02-20 23:23:32 -08:00