fix: s6-overlay entrypoint crash — replace broken bash→tini→entrypoint.sh chain #56
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/hermes-s6-overlay-entrypoint-crash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The Hermes container crashes repeatedly with SIGTERM (signal 15) in a restart loop. The root cause is in
compose.yml: the custom ENTRYPOINT chainsbash → tini -g → deprecated entrypoint.sh, which bypasses s6-overlay's/initentirely.This leaves
S6_CMD_ARG0unset, and the orphan-gflag from tini leaks into the positional args ofrc.init, triggering:The container exits → Docker
restart: always→ loop.Fix
Three changes:
compose.yml: Remove the customentrypoint:override. The image's defaultENTRYPOINT ["/init", "/opt/hermes/docker/main-wrapper.sh"]is now used. Changecommand: gateway runtocommand: ["/usr/local/bin/start-hermes.sh"].Dockerfile: Bake the newstart-hermes.shinto the image at/usr/local/bin/(same pattern as the existingrun-multi-gateways.sh).start-hermes.sh(new): A multi-profile gateway launcher designed for s6-overlay's main-program model. It:HERMES_PROFILESgosu/tinineeded — s6-overlay'smain-wrapper.shhandles privilege dropping vias6-setuidgidBefore vs After
bash → tini -g → entrypoint.sh → stage2-hook.sh (exits)s6-overlay /init → main-wrapper.sh → start-hermes.shS6_CMD_ARG0never set,-gorphan flag crashes rc.init/initsets env vars properly, clean arg passingThe old
/usr/local/bin/run-multi-gateways.shis preserved but no longer called by the CMD.