Run gopherd as a supervisor when it is not PID 1, and have the kernel notify children if gopherd dies abruptly.
# Subreaper mode for non-PID-1 deployments, plus parent-death cleanup.
subreaper: true
processes:
- name: app
command: /usr/local/bin/app
args: ["300"]
parent-death-signal: SIGTERM
on-failure: shutdownsubreaper: true— setsPR_SET_CHILD_SUBREAPERso orphaned descendants re-parent to gopherd instead of host PID 1, letting its reap loop collect them. Use when gopherd is not PID 1 (e.g.docker exec, a k8s sidecar, or nested init). Linux-only.parent-death-signal: SIGTERM— setsPR_SET_PDEATHSIG; the kernel delivers this signal toappif gopherd dies, so the child shuts down rather than being orphaned. Linux-only.
- Orphaned grandchildren of
appre-parent to gopherd and get reaped, avoiding zombies. - If gopherd is killed,
appreceives SIGTERM from the kernel and exits.
ValidateParse level — behavior is environment-dependent (cgroup limits / remote syslog / file rotation thresholds), so the test asserts the config loads and validates. Subreaper and parent-death-signal are Linux runtime behaviors; parse-validate is the honest CI-portable level.
go test ./documentation/subreaper/ -v