Process Exit Codes, Signals, and Process Lifecycle
This part is a source-backed, cross-referenced reference covering how Linux processes terminate, how statuses are reported, and how signals behave across shells, service managers, containers, and eight programming-language runtimes. Every chapter separates standards guarantees (POSIX.1-2017, ISO C/C++) from Linux implementation behavior (kernel, glibc), runtime implementation behavior, and mere conventions — and cites the primary source that supports each claim. Coverage is tracked requirement-by-requirement in the unified coverage ledger, which assigns stable IDs to every signal, interface, shell, service manager, container topic, and language requirement in scope.
Chapter map
| Section | Chapters | Ledger IDs |
|---|---|---|
| Signals — Deep Reference | Standard signals (all 31, per-architecture numbering) · Real-time signals (queuing, ordering, limits) | SIG-001 – SIG-040 |
| Signal interfaces | kill/raise · sigaction/signal · masks (sigprocmask/pthread_sigmask/sigpending) · sigwait/sigsuspend · signalfd/pidfd_send_signal · tgkill · rt_sig* ABI · async-signal-safety | IF-001 – IF-018 |
| Exit-status lifecycle | Lifecycle (exit/_exit/wait family, status encoding, zombies) · Conventions (common values, guarantees vs conventions) | EX-001 – EX-012 |
| Shell behavior | Bash · Dash · Zsh · Portability matrix | SH-001 – SH-012 |
| Service managers | systemd · OpenRC · runit · s6 · comparison | SM-001 – SM-012 |
| Containers & orchestration | PID 1 & entrypoints · Docker · Kubernetes · scenarios | CT-001 – CT-011 |
| Language chapters | C · C++ · Python · Go · Java · Rust · Node.js · OCaml · Cross-language comparison | LG-* · XC-001 – XC-009 |
| Operational troubleshooting | Common status values · Decision tree | TR-001 – TR-009 |
Scope statement
- Signal numbering is verified per architecture from the Linux kernel UAPI headers
(
include/uapi/asm-generic/signal.hplus per-arch overrides) and signal(7); the inventory names the architectures it covers and claims no completeness beyond them. - Interfaces are documented from Linux man-pages, POSIX.1-2017, and the glibc documentation, with kernel-syscall / libc-wrapper / shell-builtin / utility layering kept explicit.
- Shells covered: Bash, Dash, Zsh (version claims stated per manual).
- Service managers covered: systemd, OpenRC, runit, s6 — from official project documentation.
- Containers: Docker-compatible runtimes and Kubernetes, from official runtime/orchestrator docs.
- Languages covered: C, C++, Python, Go, Java, Rust, Node.js, OCaml — each chapter declares its
documentation version scope and carries its own end-of-chapter coverage ledger with per-API statuses,
including honestly marked
source-limitedrows.
Related Topics
- Signals (existing survey chapter) — the book’s earlier programming-model introduction; this part deepens it with source-backed per-requirement coverage
- Process control (existing chapter) —
fork/exec/waitsurvey material - Init systems (existing part) — broader init-system architecture beyond termination semantics
- Containers (existing part) — container internals beyond exit/signal propagation