{"id":6353,"library":"dumb-init","title":"Dumb-Init","description":"Dumb-init is a minimal init system for Linux containers, designed to run as PID 1. It acts as a simple process supervisor, properly handling signals sent to the container and reaping orphaned zombie processes, which is crucial for the graceful shutdown of applications and preventing resource leaks. The current version is 1.2.5.post1, and it maintains a steady, albeit infrequent, release cadence with minor updates and bug fixes.","status":"active","version":"1.2.5.post1","language":"en","source_language":"en","source_url":"https://github.com/Yelp/dumb-init/","tags":["process management","init system","docker","containers","signal handling","PID 1","linux"],"install":[{"cmd":"pip install dumb-init","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Runtime dependency for the statically-linked C binary on Linux systems.","package":"libc6","optional":false},{"reason":"Required for compiling the C binary if pre-built wheels are not available for your platform during pip installation.","package":"gcc","optional":true}],"imports":[],"quickstart":{"code":"FROM python:3.9-slim-buster\n\n# Install dumb-init\nRUN pip install dumb-init\n\nWORKDIR /app\nCOPY my_app.py .\n\n# Use dumb-init as the ENTRYPOINT\n# Must use JSON array syntax to ensure dumb-init is PID 1\nENTRYPOINT [\"dumb-init\", \"--\"]\n\n# Your actual application command\nCMD [\"python\", \"my_app.py\"]","lang":"dockerfile","description":"This Dockerfile demonstrates how to install and use `dumb-init` as the entrypoint for a Python application. `dumb-init` will become PID 1, properly forwarding signals to `my_app.py` and reaping any zombie processes. Ensure your `CMD` also uses JSON array syntax."},"warnings":[{"fix":"Always use `dumb-init` (or a similar init system like `tini`) as your container's `ENTRYPOINT` with JSON array syntax. For example: `ENTRYPOINT [\"dumb-init\", \"--\"]`.","message":"Processes running as PID 1 in Linux containers (e.g., Docker) have special kernel behavior and do not correctly handle signals (like SIGTERM) or reap zombie child processes by default. Failing to use an init system like `dumb-init` can lead to containers that cannot be gracefully stopped or accumulate defunct processes.","severity":"gotcha","affected_versions":"All versions, fundamental Linux container behavior"},{"fix":"Update references to binary names in build scripts or Dockerfiles if you are directly accessing the `dumb-init` binary by its architecture-specific name, or ensure your package manager handles the aliasing.","message":"Versions 1.2.2 and later changed the naming convention for pre-built binaries from Debian architecture names (e.g., `amd64`, `arm64`) to Linux kernel names (e.g., `x86_64`, `aarch64`). While older names might be kept for compatibility in some Debian packages, this could affect custom build systems or scripts relying on specific binary names.","severity":"breaking","affected_versions":">=1.2.2"},{"fix":"Always use the JSON array (exec form) syntax for `ENTRYPOINT` and `CMD` when using `dumb-init` to ensure it is PID 1. Example: `ENTRYPOINT [\"dumb-init\", \"--\"]` and `CMD [\"python\", \"my_app.py\"]`.","message":"Using the 'shell form' for `ENTRYPOINT` or `CMD` (e.g., `ENTRYPOINT dumb-init -- python my_app.py`) will cause `sh -c` to become PID 1, not `dumb-init`. This defeats the purpose of `dumb-init` as the shell will not correctly forward signals.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `dumb-init` version 1.2.2 or newer to mitigate this race condition.","message":"A race condition in versions prior to 1.2.2 could cause the child process to receive SIGHUP and SIGCONT signals very shortly after startup, particularly in some container or virtualization environments.","severity":"gotcha","affected_versions":"<1.2.2"},{"fix":"Consider using an earlier Python version or a different dependency manager on macOS, or consult the GitHub issues for potential workarounds or newer fixes if this specific environment is required.","message":"Installation of `dumb-init` (version 1.2.5.post1) has been reported to fail on macOS with Python 3.12.4 and Poetry, likely due to issues with PEP 517 builds.","severity":"gotcha","affected_versions":"1.2.5.post1 on macOS with Python 3.12.4 and Poetry"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}