A minimal process that holds a Linux PID namespace open.
The kernel destroys a PID namespace, and kills everything in it, as soon as
its PID 1 exits. Unlike other namespaces, it cannot be kept alive with a bind
mount. containerd-pause runs as PID 1 of the namespace and does nothing else:
- it ignores
SIGINTandSIGTERM, so onlySIGKILLstops it; - it sets
SA_NOCLDWAITonSIGCHLD, so the kernel reaps processes reparented to it; - it sleeps in
pause(2)until killed.
Release builds are no_std and link only libc.
cargo build --release --bin containerd-pauseSpawn the binary with CLONE_NEWPID (for example
unshare --pid --fork containerd-pause) and send it SIGKILL to tear the
namespace down.