cross-posted from: https://programming.dev/post/36342010

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).

  • chameleon@fedia.io
    link
    fedilink
    arrow-up
    4
    ·
    3 days ago

    scripts mix configuration with logic and this was a big reason why a lot of distributions switched to systemd in the first place

    What was really wrong with the old BSD-style rc/init systems is that they mixed configuration with the logic required to start/stop the service at all, and that that logic was running in the same session it was being executed from (inheriting the environment, FDs and the like). These daemontools-style supervisors don’t have that problem, the run script is essentially just systemd’s ExecStart= and it gets forked off from the supervisor itself and is then managed by it. Lots of them are just #!/bin/sh \n exec coolservice.

    There’s plenty more things that systemd does pretty well that this doesn’t do (dependency management seems to be sorely lacking here in particular), but this kind of approach is much closer to it than the old rc scripts.