nitro, a tiny but flexible init system and process supervisor Overview Nitro is a tiny process supervisor that also can be used as pid 1 on Linux. There are four main applications it is designed for: As init for a Linux machine for embedded, desktop or server purposes As init for a Linux initramfs As init for a Linux container (Docker/Podman/LXC/Kubernetes) As unprivileged supervision daemon on POSIX systems Nitro is configured by a directory of scripts, defaulting to /etc/nitro (or the first command line argument). Requirements Kernel support for Unix sockets tmpfs or writable /run on another fs Benefits over other systems All state is kept in RAM, works without tricks on read-only root file systems. Efficient event-driven, polling free operation. Zero memory allocations during runtime. No unbounded file descriptor usage during runtime. One single self-contained binary, plus one optional binary to control the system. No configuration compilation steps needed, services are simple directories containing scripts. Supports reliable restarting of services. Reliable logging mechanisms per service or as default. Support for logging chains spread over several services. Works independently of properly set system clock. Can be run on FreeBSD from /etc/ttys (sets up file descriptors 0, 1, 2). Tiny static binary when using musl libc. Services Every directory inside /etc/nitro (or your custom service directory) can contain several files: setup, an optional executable file that is run before the service starts. It must exit with status 0 to continue. run, an optional executable file that runs the service; it must not exit as long as the service is considered running. If there is no run script, the service is considered a “one shot”, and stays “up” until it’s explicitly taken “down”. finish, an optional executable file that is run after the run process finished. It is passed two arguments, the exit status of the run process (or -1 if it was killed by a signal) and the signal that...
First seen: 2025-08-22 20:27
Last seen: 2025-08-23 02:32