hermes-s6-container-supervision

Modify and debug the s6-overlay supervision tree inside the Hermes Agent Docker image.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/CHENHUI-X/toolbox --skill hermes-s6-container-supervision-chenhui-x
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hermes-s6-container-supervision
Source: https://github.com/CHENHUI-X/toolbox/tree/main/custom-skills/software-development/hermes-s6-container-supervision
Command: npx skills add https://github.com/CHENHUI-X/toolbox --skill hermes-s6-container-supervision-chenhui-x

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on the Hermes Agent Docker image requires understanding its s6-overlay v3 supervision tree — cont-init.d boot scripts, static s6-rc.d services, runtime-registered per-profile gateways, and the Architecture B CMD pattern. Without this knowledge, developers struggle to add services, debug crash-looping gateways, or understand why containers exit 143. ## Core Features & Use Cases - Service management guidance: Step-by-step recipes for adding static s6-rc.d services, registering per-profile gateway slots under /run/service, and controlling them with s6-svc. - Debugging playbooks: Diagnose gateway crash loops, reconciler failures, permission errors from root-owned profile directories, and exit-code 143 shutdown issues. - Architecture reference: Explains why the container uses the CMD-as-main-program pattern (Architecture B) instead of an s6-supervised main service, including the s6-overlay v3 mechanics that forced the pivot. - Use Case: A developer adds a new supervised service to the Hermes Docker image by creating the s6-rc.d type/run files, wiring dependencies, and verifying with the docker test harness. ## Quick Start Ask the assistant to add a new supervised service to the Hermes Docker image or to diagnose why a profile gateway keeps restarting.

Frequently Asked Questions about hermes-s6-container-supervision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new supervised service to an s6-overlay Docker image?

Create a directory under docker/s6-rc.d/<name> with a type file containing longrun and a run script using #!/command/with-contenv sh. Add an empty dependencies.d/base file and register it in user/contents.d so the Dockerfile COPY picks it up automatically.

Why does my s6-overlay container always exit with code 143?

Exit 143 happens because /run/s6/basedir/bin/halt does not propagate the exit code written to the container-results file, so shutdown always returns SIGTERM. To get a real exit code, let the CMD (main-wrapper.sh) exit normally instead of calling halt.

Why does s6-svstat say command not found when I run docker exec?

The /command directory containing s6-overlay binaries is only on PATH for processes spawned by the supervision tree, not for docker exec sessions. Always use the absolute path, such as /command/s6-svstat /run/service/gateway-<name>.

Why does my per-profile gateway keep restarting in a crash loop?

A gateway showing down (exitcode 1) in s6-svstat usually means the profile has no model or auth configured, so the gateway exits immediately and s6 restarts it. Run hermes -p <profile> setup first; the supervisor will keep retrying until configuration succeeds.

How does the container restore profile gateways after docker restart?

The cont-init.d script 02-reconcile-profiles runs hermes_cli.container_boot, which walks $HERMES_HOME/profiles, reads each gateway_state.json, recreates /run/service/gateway-<name> slots, and auto-starts only those whose prior state was running.