hermes-s6-container-supervision

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

Updated Jul 7, 2026
One-click install
npx skills add https://github.com/episvr/USTB-2026-SummerInternship --skill hermes-s6-container-supervision-episvr
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: hermes-s6-container-supervision
Source: https://github.com/episvr/USTB-2026-SummerInternship/tree/main/hermes-config/optional-skills/devops/hermes-s6-container-supervision
Command: npx skills add https://github.com/episvr/USTB-2026-SummerInternship --skill hermes-s6-container-supervision-episvr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on the Hermes Agent Docker image requires understanding its s6-overlay v3 supervision architecture: why the CMD is a main-wrapper script instead of a supervised service, how per-profile gateways are registered under /run/service, and why containers exit 143 when halt is invoked. This Skill provides the architecture map, key file locations, and operational recipes needed to safely modify or debug that stack. ## Core Features & Use Cases - Architecture Reference: Explains the full supervision tree — cont-init.d boot scripts, static s6-rc.d services, runtime-registered profile gateways, and the Architecture B CMD-as-main-program pattern with its exit-code rationale. - Operational Recipes: Provides copy-ready commands for verifying s6 as PID 1, inspecting gateway state with s6-svstat, bringing services up/down with s6-svc, and reading the container-boot reconciler log. - Extension Guides: Step-by-step instructions for adding a new static s6-rc.d service and changing the per-profile gateway run script in hermes_cli/service_manager.py. - Use Case: A developer adds a new supervised service to the Hermes Docker image, then debugs why a profile gateway crash-loops after docker restart by checking s6-svstat output and the reconciler log. ## Quick Start Ask the AI to explain why a per-profile gateway is not surviving docker restart in the Hermes container and how to inspect its s6 service state.

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 service directory under docker/s6-rc.d/<name> with a type file containing longrun and a run script using #!/command/with-contenv sh. Add empty dependencies.d/base and user/contents.d/<name> files so it joins the base and user bundles; the Dockerfile COPY picks it up automatically.

How to debug a service that keeps restarting in s6-overlay?▼

Run /command/s6-svstat /run/service/<name> inside the container; output like down (exitcode N), normally up, want up indicates a crash loop where s6 keeps restarting the process. Check the service logs and fix the underlying configuration, after which the next restart attempt stays up.

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

Exit 143 occurs because /run/s6/basedir/bin/halt does not propagate the exit code written to the container-results file, so containers always report SIGTERM. To get a real exit code, let the CMD exit normally instead of calling halt or s6-svscanctl -t from a finish script.

Why does s6-svstat say command not found when using docker exec?▼

The /command directory containing s6-overlay binaries is on PATH only for processes spawned by the supervision tree, not for docker exec sessions. Always invoke the absolute path, for example /command/s6-svstat, when running s6 tools via docker exec.

Can cont-init.d scripts receive docker run arguments in s6-overlay v3?▼

No, cont-init.d scripts receive no CMD arguments in s6-overlay v3, so boot scripts cannot parse docker run flags to configure services. The Hermes image solves this with the Architecture B pattern: ENTRYPOINT ["/init", "main-wrapper.sh"] routes user args through the CMD instead.