Skip to content

Latest commit

 

History

History

pause

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

containerd-pause

Crates.io Crates.io CI

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 SIGINT and SIGTERM, so only SIGKILL stops it;
  • it sets SA_NOCLDWAIT on SIGCHLD, so the kernel reaps processes reparented to it;
  • it sleeps in pause(2) until killed.

Release builds are no_std and link only libc.

Usage

cargo build --release --bin containerd-pause

Spawn the binary with CLONE_NEWPID (for example unshare --pid --fork containerd-pause) and send it SIGKILL to tear the namespace down.