---
title: Container-Init (PID 1)
---
# Container-Init (PID 1)
`sysg init` runs systemg as a container's PID 1 on linux-gnu and linux-musl
(Alpine is a first-class target), replacing tini/s6/supervisord combinations
with one supervisor that already owns lifecycle, logs, and diagnostics.
```dockerfile
ENTRYPOINT ["sysg", "init", "--config", "/etc/systemg/systemg.yaml"]
```
`sysg init` requires that the process actually is PID 1 and implies system
mode. It boots the manifest, reaps adopted orphans, handles shutdown signals,
and exits with the teardown verdict.
## What PID 1 changes
PID 1 inherits every orphaned process in the container and must reap them;
default signal dispositions differ; shutdown means tearing down every service
in reverse dependency order and exiting with a meaningful status. All wait
statuses route through a centralized broker, so an adopted orphan's exit is
never mistaken for a managed service's.
## Diagnostics
- [SG0711](/reference/dialog/codes#sg0711) — container-init unsupported on
this platform (e.g. macOS)
- [SG0712](/reference/dialog/codes#sg0712) — PID 1 prerequisites missing
(e.g. `/proc` not mounted)
- [SG0713](/reference/dialog/codes#sg0713) — shutdown incomplete: services
survived reverse-order teardown
- [SG0714](/reference/dialog/codes#sg0714) — live supervisor upgrade
refused in container-init mode
## Known constraint
Live supervisor upgrade is forbidden in container-init mode: a failed exec in
PID 1 kills the container and everything in it. Upgrade the image instead.