Bug
When running the Hermes gateway in a Docker container, the /restart slash command shuts down the gateway permanently instead of restarting it.
Root Cause
_handle_restart_command in gateway/run.py spawns a detached subprocess to restart the gateway when not running under systemd. In Docker, when the gateway exits, tini (PID 1) exits too, Docker stops the container, and the detached helper is killed before it can restart anything.
Fix
Detect Docker (/.dockerenv) and Podman (/run/.containerenv) containers and use the service restart path (exit code 75) instead. Combined with a restart policy (unless-stopped), Docker handles the restart.
Environment
nousresearch/hermes-agent:latest on Unraid
- Host networking, tini as PID 1
- Restart policy must be set to
unless-stopped or on-failure
Bug
When running the Hermes gateway in a Docker container, the
/restartslash command shuts down the gateway permanently instead of restarting it.Root Cause
_handle_restart_commandingateway/run.pyspawns a detached subprocess to restart the gateway when not running under systemd. In Docker, when the gateway exits, tini (PID 1) exits too, Docker stops the container, and the detached helper is killed before it can restart anything.Fix
Detect Docker (
/.dockerenv) and Podman (/run/.containerenv) containers and use the service restart path (exit code 75) instead. Combined with a restart policy (unless-stopped), Docker handles the restart.Environment
nousresearch/hermes-agent:lateston Unraidunless-stoppedoron-failure