You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Container accumulates zombie processes — needs tini or --init as PID 1 wrapper #77885
When OpenClaw runs as PID 1 in a Docker container (the default), the Node.js process does not reap orphaned child processes. Node's default SIGCHLD handling only calls waitpid() for children it spawned via child_process — it does NOT perform the waitpid(-1) sweep that a proper init system does.
Every process spawned via the exec tool that exits becomes a zombie. Over a container's lifetime this accumulates hundreds of zombie entries in the process table.
Observed
PID 1: node /app/node_modules/.bin/openclaw start
After ~2 hours of normal operation: 148 zombie processes (bash, git, node, python, etc.)
Zombie count grows monotonically — they are never reaped
Chromium-based tools that exit as zombies poison lock files, preventing browser servers from restarting
Root Cause
Node.js is not a proper init system. When it runs as PID 1, orphaned children get reparented to it, but it never calls waitpid(-1, WNOHANG) to reap them.
Fix
tini is already installed in the container at /usr/local/bin/tini. It just needs to be used as the entrypoint wrapper.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open. Current main only covers the bundled Compose and Podman launchers with an init process; the root image and several cloud/manual deployment examples still start Node directly as PID 1, so the reported container zombie risk is not already resolved.
Reproducibility: Do we have a high-confidence way to reproduce the issue? Not live-reproduced here, but the source path is clear: the root Dockerfile starts Node as PID 1 with no entrypoint init, while related launchers explicitly opt into init handling.
Next step
This is a narrow Docker runtime/docs/test repair with clear affected files; the repair PR should include a live Docker smoke proving the final process tree uses an init wrapper.
Review details
Best possible solution:
Add an image-level init wrapper or verified equivalent for long-running OpenClaw containers, then align the Docker/Fly/VM docs and regression checks while preserving the existing Compose and Podman init coverage.
Do we have a high-confidence way to reproduce the issue?
Do we have a high-confidence way to reproduce the issue? Not live-reproduced here, but the source path is clear: the root Dockerfile starts Node as PID 1 with no entrypoint init, while related launchers explicitly opt into init handling.
Is this the best way to solve the issue?
Is this the best way to solve the issue? Yes in direction: fix the container launch boundary with an init wrapper or Docker/Podman init setting, rather than adding OpenClaw-specific process-reaping logic inside the Node app.
Acceptance criteria:
pnpm test src/dockerfile.test.ts src/docker-setup.e2e.test.ts src/docker-image-digests.test.ts src/docker-build-cache.test.ts
git diff --check
Build the root Docker image and run a short container smoke proving PID 1 is the init wrapper and the gateway healthcheck/startup path still works
What I checked:
Root image starts Node directly: The runtime Dockerfile installs common utilities but not tini, then ends with CMD ["node", "openclaw.mjs", "gateway", "--allow-unconfigured"] and no ENTRYPOINT, so a plain docker run makes Node PID 1. (Dockerfile:290, e6f5f5693d22)
Compose path already uses Docker init: The bundled Compose service has init: true for both openclaw-gateway and openclaw-cli, which means this problem is already partly addressed for the repo-owned Compose path. (docker-compose.yml:62, e6f5f5693d22)
Podman launcher already uses init: The manual Podman launcher passes --init for both setup and detached gateway runs, another sign that container launchers in this repo already expect an init wrapper where the runtime supports it. (scripts/run-openclaw-podman.sh:535, e6f5f5693d22)
Cloud docs still start Node directly: Fly and VM Compose examples still document node dist/index.js gateway ... as the container process without an init wrapper; Hetzner and GCP examples also omit init: true. Public docs: docs/install/fly.md. (docs/install/fly.md:64, e6f5f5693d22)
Issue discussion: The issue body reports a long-running Docker deployment with node /app/node_modules/.bin/openclaw start as PID 1 and 148 zombie processes after roughly two hours; there are no comments or maintainer signals that supersede the report.
Recent container ownership: Recent container hardening history shows f9da4843652e28678839f9c0f927ae33840281ff touched docker-compose.yml and docs/install/docker.md, while current root Dockerfile lines blame to 0e7073ad899aa559d05f6501269c1084e10aec20 in this checkout.
Likely related people:
VintageAyu: Commit f9da4843652e28678839f9c0f927ae33840281ff recently hardened the bundled Docker Compose services and touched the Docker setup docs, including the area where init: true is now present. (role: recent container hardening contributor; confidence: medium; commits: f9da4843652e; files: docker-compose.yml, docs/install/docker.md)
steipete: The current checkout blames the root Dockerfile runtime stage and final container command to 0e7073ad899aa559d05f6501269c1084e10aec20; history is compact in this checkout, but this is the central image path for the requested fix. (role: current Dockerfile/runtime image maintainer; confidence: medium; commits: 0e7073ad899a; files: Dockerfile)
Remaining risk / open question:
I did not run a live current-main Docker container to count zombie processes; the failure is source-reproducible but the exact accumulation rate comes from the reporter.
The issue assumes tini already exists at /usr/local/bin/tini, but current Dockerfile inspection does not show it being installed, so a fix must verify the actual runtime binary path or add a minimal init package deliberately.
Codex review notes: model gpt-5.5, reasoning high; reviewed against e6f5f5693d22.
Re-review progress:
State: Complete
Detail: The targeted re-review finished, the durable review comment was updated, and the synced verdict was routed.
Activity
clawsweeper commentedon May 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open. Current main only covers the bundled Compose and Podman launchers with an init process; the root image and several cloud/manual deployment examples still start Node directly as PID 1, so the reported container zombie risk is not already resolved.
Reproducibility: Do we have a high-confidence way to reproduce the issue? Not live-reproduced here, but the source path is clear: the root Dockerfile starts Node as PID 1 with no entrypoint init, while related launchers explicitly opt into init handling.
Next step
This is a narrow Docker runtime/docs/test repair with clear affected files; the repair PR should include a live Docker smoke proving the final process tree uses an init wrapper.
Review details
Best possible solution:
Add an image-level init wrapper or verified equivalent for long-running OpenClaw containers, then align the Docker/Fly/VM docs and regression checks while preserving the existing Compose and Podman init coverage.
Do we have a high-confidence way to reproduce the issue?
Do we have a high-confidence way to reproduce the issue? Not live-reproduced here, but the source path is clear: the root Dockerfile starts Node as PID 1 with no entrypoint init, while related launchers explicitly opt into init handling.
Is this the best way to solve the issue?
Is this the best way to solve the issue? Yes in direction: fix the container launch boundary with an init wrapper or Docker/Podman init setting, rather than adding OpenClaw-specific process-reaping logic inside the Node app.
Acceptance criteria:
What I checked:
tini, then ends withCMD ["node", "openclaw.mjs", "gateway", "--allow-unconfigured"]and noENTRYPOINT, so a plaindocker runmakes Node PID 1. (Dockerfile:290, e6f5f5693d22)init: truefor bothopenclaw-gatewayandopenclaw-cli, which means this problem is already partly addressed for the repo-owned Compose path. (docker-compose.yml:62, e6f5f5693d22)--initfor both setup and detached gateway runs, another sign that container launchers in this repo already expect an init wrapper where the runtime supports it. (scripts/run-openclaw-podman.sh:535, e6f5f5693d22)node dist/index.js gateway ...as the container process without an init wrapper; Hetzner and GCP examples also omitinit: true. Public docs:docs/install/fly.md. (docs/install/fly.md:64, e6f5f5693d22)node /app/node_modules/.bin/openclaw startas PID 1 and 148 zombie processes after roughly two hours; there are no comments or maintainer signals that supersede the report.f9da4843652e28678839f9c0f927ae33840281fftoucheddocker-compose.ymlanddocs/install/docker.md, while current root Dockerfile lines blame to0e7073ad899aa559d05f6501269c1084e10aec20in this checkout.Likely related people:
f9da4843652e28678839f9c0f927ae33840281ffrecently hardened the bundled Docker Compose services and touched the Docker setup docs, including the area whereinit: trueis now present. (role: recent container hardening contributor; confidence: medium; commits: f9da4843652e; files:docker-compose.yml,docs/install/docker.md)0e7073ad899aa559d05f6501269c1084e10aec20; history is compact in this checkout, but this is the central image path for the requested fix. (role: current Dockerfile/runtime image maintainer; confidence: medium; commits: 0e7073ad899a; files:Dockerfile)Remaining risk / open question:
tinialready exists at/usr/local/bin/tini, but current Dockerfile inspection does not show it being installed, so a fix must verify the actual runtime binary path or add a minimal init package deliberately.Codex review notes: model gpt-5.5, reasoning high; reviewed against e6f5f5693d22.
Re-review progress: