Use tini as container init - #21
Conversation
|
Deployment verification from Railway service openclaw-railway-template:\n\n- Deployed this Dockerfile shape successfully via Railway CLI upload.\n- PID 1 is now /usr/bin/tini -- alphaclaw start.\n- Healthcheck remains healthy.\n- Post-deploy process scan showed no defunct zombie processes.\n- Public OpenClaw router stayed healthy.\n\nThis fixes the observed production issue where node as PID 1 did not reap adopted child processes from cron/subprocess workflows. |
|
Strong +1 on this. Hit the same fork failure on Railway and the diagnosis matches exactly what this PR fixes. About 67 minutes after a fresh deploy, my container had 87 defunct
Combined with ~100 live processes, the container exhausts its PID slots in 13–14 hours after each restart. After that, every A few older closed issues look like the same root cause wearing different masks:
The patch here is the right structural fix — |
This runs OpenClaw under tini so the container has a real PID 1 reaper.\n\nWhy:\n- Railway/OpenClaw cron and subprocess workflows can leave orphaned child processes.\n- With node as PID 1, adopted children can remain as defunct zombies.\n- tini is the standard minimal init for containers and forwards signals while reaping children.\n\nChange:\n- Install Debian tini in the image.\n- Use ENTRYPOINT ["/usr/bin/tini", "--"] before the existing alphaclaw start CMD.\n\nVerified on Railway by deploying the same Dockerfile shape: PID 1 became /usr/bin/tini -- alphaclaw start, healthcheck stayed healthy, and no zombie processes were present after post-deploy smoke checks.