Devuan and various systemd-free Linux distributions provide alternative init systems. runit is among the most barebones and lightest. Having a small c

Using Runit on Devuan

submited by
Style Pass
2024-10-01 04:00:04

Devuan and various systemd-free Linux distributions provide alternative init systems. runit is among the most barebones and lightest. Having a small code base makes it easier to maintain and also audit for bugs and security issues. It is able to run on other Unices like *BSD, MacOSX, etc., as well. In this article, I am going to cover the basics of the runit init scheme with Devuan as a base. However, most concepts and commands should be the same for other distributions. You may refer to the references at the end for learning in more detail.

According to the official documentaion, runit is an init scheme with service supervision. That means it handle automatic starting of services during boot, as well as monitoring and restarting them. Conforming to the UNIX philosophy, runit consists of various small tools and binaries (albeit not to the extent of being bloated *ahem* systemd *ahem*) for interacting with it and other daemons. Like with most init systems, the kernel loads the first process – /sbin/init which is provided by the runit-init(8) program. It then replaces itself with runit(8). runit is what performs the system’s booting, running and shutting down and it does so in three stages:

A standard installation of runit has 2 runlevels, default and single. A runlevel directory contains symlinks to other service directories. Most tasks are performed and most services are started in the default runlevel. But we can make our own runlevels by creating a new folder in/etc/runit/runsvdir/ and symlinking our desired services to that runlevel. My Devuan installation has two other runlevels created.

Leave a Comment