From 13d45312809afbaab904960d7e80eb15e5c3c037 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:53:50 +0000 Subject: [PATCH 1/3] Initial plan From 9c92043b7a8295702bd2e91af1b76d9b0044f615 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 17:04:16 +0000 Subject: [PATCH 2/3] Fix restart loop: use s6-overlay /init as PID 1, remove tini wrapper The upstream nousresearch/hermes-agent:v2026.6.5 replaced tini with s6-overlay for PID 1 supervision, and added a backward-compat shim: ln -sf /init /usr/bin/tini Our entrypoint was calling `exec tini -g -- "$0" "$@"` which became `exec /init -g -- /usr/local/bin/entrypoint.sh gateway run`. s6-overlay treated `-g` as the CMD to run, so rc.init at line 91 tried to execute `-g` as a command -> not found -> container crashed -> restart loop. Fix: - Dockerfile: use `/init` as PID 1 via ENTRYPOINT ["/init", "/usr/local/bin/entrypoint.sh"] - entrypoint.sh: change shebang to #!/command/with-contenv bash so s6-overlay properly repopulates environment variables before our script runs; remove the tini-wrapping block that caused the crash --- Dockerfile | 2 +- entrypoint.sh | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index b88a1b1..1bba8e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,5 +29,5 @@ EXPOSE 3000 8080 8081 7681 HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \ CMD curl -f http://localhost:3000/health || exit 1 -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +ENTRYPOINT ["/init", "/usr/local/bin/entrypoint.sh"] CMD ["gateway", "run"] diff --git a/entrypoint.sh b/entrypoint.sh index 0f0bc33..366fbc3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/command/with-contenv bash # DAppNode Hermes Agent entrypoint # Based on upstream docker/entrypoint.sh (v2026.5.7) with DAppNode additions. set -e @@ -86,14 +86,6 @@ if [ "$(id -u)" = "0" ]; then drop_to_hermes "$@" fi -# If this script is PID 1 after the privilege drop, insert tini while still -# running as `hermes`. That keeps signal forwarding/zombie reaping without -# making the setup wizard signal a root-owned PID 1 on restart. -if [ "${DAPPNODE_TINI_WRAPPED:-}" != "1" ] && [ "$$" = "1" ] && command -v tini >/dev/null 2>&1; then - export DAPPNODE_TINI_WRAPPED=1 - exec tini -g -- "$0" "$@" -fi - # --- Running as hermes from here --- export HOME="$HERMES_HOME/home" export USER="${USER:-hermes}" From 39d83857cfc6cc610b571618ef030b128af9d7e3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:28:41 +0000 Subject: [PATCH 3/3] Fix restart loop: guard seed cp commands against missing source files The upstream .dockerignore excludes .env.example and *.md files from the image, so /opt/hermes/.env.example and /opt/hermes/docker/SOUL.md do not exist inside the container. With set -e in the entrypoint, the unconditional `cp` on a missing source causes the script to exit with an error, triggering a container restart loop. Mirror the upstream stage2-hook.sh `seed_one` pattern: add a `[ -f "$INSTALL_DIR/" ]` guard to all three cp seed commands so they are silently skipped when the source file is absent. --- entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 366fbc3..b21d3f4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -100,14 +100,13 @@ rm -f "$HERMES_HOME"/gateway.lock "$HERMES_HOME"/gateway.pid # --- Bootstrap config files (mirrors upstream entrypoint) --- mkdir -p "$HERMES_HOME"/{cron,sessions,logs,hooks,memories,skills,skins,plans,workspace,home} -if [ ! -f "$HERMES_HOME/.env" ]; then +if [ ! -f "$HERMES_HOME/.env" ] && [ -f "$INSTALL_DIR/.env.example" ]; then cp "$INSTALL_DIR/.env.example" "$HERMES_HOME/.env" fi -if [ ! -f "$HERMES_HOME/config.yaml" ]; then +if [ ! -f "$HERMES_HOME/config.yaml" ] && [ -f "$INSTALL_DIR/cli-config.yaml.example" ]; then cp "$INSTALL_DIR/cli-config.yaml.example" "$HERMES_HOME/config.yaml" fi - -if [ ! -f "$HERMES_HOME/SOUL.md" ]; then +if [ ! -f "$HERMES_HOME/SOUL.md" ] && [ -f "$INSTALL_DIR/docker/SOUL.md" ]; then cp "$INSTALL_DIR/docker/SOUL.md" "$HERMES_HOME/SOUL.md" fi