Skip to content
Frank Earl edited this page Aug 20, 2017 · 8 revisions

runit home page

So, what is runit?

From Gerrit Pape's original description:

"runit is a cross-platform Unix init scheme with service supervision, a replacement for sysvinit, and other init schemes. It runs on GNU/Linux, *BSD, MacOSX, Solaris, and can easily be adapted to other Unix operating systems."

If your OS choice is a POSIX-like OS at it's core, the odds are rather good that runit will work rather well as an init/services engine and framework for that OS.


The program runit is intended to run as POSIX/SysV process number 1; it is automatically started by the runit-init /sbin/init-replacement if this is started by the kernel of your chosen OS.

runit performs the system's booting, running and shutting down in three stages:

  • Stage 1: runit starts /etc/runit/1 and waits for it to terminate. The system's one time initialization tasks are done here. /etc/runit/1 has full control over /dev/console to be able to start an emergency shell in case the one time initialization tasks fail.

  • Stage 2: runit starts /etc/runit/2 which should not return until the system is going to halt or reboot; if it crashes, it will be restarted. Normally, /etc/runit/2 runs runsvdir. In Stage 2 runit optionally handles the INT signal (ctrl-alt-del keyboard request on Linux/i386).

  • Stage 3: If runit is told to halt or reboot the system, or Stage 2 returns without errors, it terminates Stage 2 if it is running, and runs /etc/runit/3. The systems tasks to shutdown and halt or reboot are done here.

The program runit-init is intended to replace /sbin/init. The command init 0 tells runit to halt the system, and init 6 to reboot. Runlevels are handled through the runsvdir and runsvchdir programs. Service dependencies are resolved automatically.

runit is optimized for reliability and small size. The amount of code in process number 1 should be minimal. This is for security and robustness reasons as this is the base process for the whole of the operating system. It should not have anything other than the base level dispatching of other processes. Additional features or functionality past this create additional attack surfaces for exploitation on your Operating System.


Clone this wiki locally