Enter s6 Supervisor

I run Fedora and Manjaro (since yesterday) as my day to day GNU/Linux operating systems. Though still quite intimidating, I use systemd on both of them. However, from time to time I have those grand dreams of a “better init”. System V init seems like a hodgepodge of Shell scripts and has so many downsides that people often feel prompted to write whole blogs about them. Going back to the ways of the init past doesn’t seem viable (or at least convenient) anymore. In addition, modern GNU/Linux distributions crawl with helper scripts and utilities that are supposed to make the lives of users easier. They of course do, but then there is the noticeable overhead and dramatically increased complexity. Obviously, no sane GNU/Linux developer or user wants their favorite open-source creation to turn into the Frankenstein that is Microsoft Windows.

An additional incentive for considering alternative system service supervisors and inits is the rising trend of building Linux containers. Light system-level virtualization has been a standard in non-Linux Unices for decades (Solaris’ zones, FreeBSD jails, etc.) and now the GNU/Linux crowd wants a fair share of it as well. Containers are usually meant to serve a limited number of tasks (kernel building, firewall testing, etc.) so running the whole systemd suite is an overkill. Also, it was never designed for simplicity in the first place. Update: recently, systemd got a utility called systemd-nspawn. It’s the systemd equivalent to a zone/jail builder tool. Of the systemd alternatives it is definitely worth mentioning OpenRC as the prominent “other” supervisor. It powers Gentoo, Manjaro’s OpenRC edition(s) and other GNU/Linux distributions which shy away from systemd. However, there are plenty of less popular supervisors like uselessd (pun at systemd), runit, nosh and s6. The last one deserves probably the most attention as it is often used in Linux containers with great success. Maybe eventually someone will build a complete virtualization technology based on it, who knows.

One can read about s6 primarily here, but also some success container stories here and here. It’s useful to know that the groundwork has been paved and that s6 is indeed viable in terms of light process supervision. However, I would like to go a step further and set up a whole GNU/Linux operating system on it. Firstly, in a chroot environment, then on a separate partition. It will definitely not be easy, but may prove worthwhile for the entirety of the GNU/Linux community. Several points need to be considered and addressed prior:

  • s6 doesn’t have its own init binary, but one was already written by some of the skarnet.org people. Alternatively, /bin/sh can serve as the simplest init substitute. Then, it hands over system control to s6-svscan and things continue smoothly from there.
  • The 3 init stages (init, running, shutting down) need to be connected to the basic utilities, otherwise the system will not boot fully, will lack some processes or will require a hard poweroff.
  • Common processes such as NetworkManager, policykit, wicked, dbus, etc. need to be made compatible with s6. Some additional services can be launched via a desktop manager, but network connectivity is a must in the command-line already.
  • The new supervisor (s6) should not break existing functionalities people are used to, like auto-mounting devices or handling keyboard key events.
  • The whole setup process needs to be documented and partially automated to ease reproducibility and maintenance.

Update: I believe I did not do enough justice to other alternative inits and supervisor suites. Runit is actually worth considering on equal grounds as s6, because it’s been built with Unix system management in mind and already found its testbed in Void Linux. Not to mention, it was tested on several other distributions as a drop-in replacement for systemd. Finally, it has its own runit-init utility that works as the PID 1 init substitute.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s