From 65270743f03969ac36ab65db2b4879da0445b8e1 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 9 Jan 2021 09:12:14 +0000 Subject: Add a runit conversion FAQ to quickstart --- doc/index.html | 2 +- doc/quickstart.html | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 99 insertions(+), 2 deletions(-) diff --git a/doc/index.html b/doc/index.html index 46a8173..ac5f1fa 100644 --- a/doc/index.html +++ b/doc/index.html @@ -59,7 +59,7 @@ kernel command line
diff --git a/doc/quickstart.html b/doc/quickstart.html index 253429f..3fb2d19 100644 --- a/doc/quickstart.html +++ b/doc/quickstart.html @@ -16,7 +16,7 @@ skarnet.org

-

Quickstart for s6-linux-init

+

Quickstart and FAQ for s6-linux-init

Quickstart

@@ -49,5 +49,102 @@ your old init system and need to use a reboot command that matches it. /sbin/poweroff or /sbin/reboot as usual. +

FAQ

+ +

How do I convert a runit setup to a s6 one ?

+ +

+ A runit and a s6 setup are very similar. There are just three things you +need to pay attention to: +

+ + + +

+ In a runit setup, you have +the runit program running as +pid 1, and sequentially spawning /etc/runit/1, then /etc/runit/2 +which contains the invocation of +runsvdir, and finally +/etc/runit/3 at shutdown time when runsvdir is dead. +

+ +

+ In a s6 setup that you have booted via +s6-linux-init, the scanner, +s6-svscan (the equivalent +of runsvdir), runs as +pid 1, very early, and remains there for the whole lifetime of the machine. At +boot time, the /etc/s6-linux-init/current/scripts/rc.init script is run, with +the supervision tree already in place; when it exits, the system is supposed to +be in a fully-booted, stable state. At shutdown time (on receipt of a shutdown +command), the /etc/s6-linux-init/current/scripts/rc.shutdown script is run, +with the supervision tree still in place; when it exits, the +filesystems will be unmounted and the machine will be rebooted and/or stopped. +

+ +

+ So, the quickest way to port a runit setup to a s6-linux-init one is to: +

+ + + +

+ Once you have done that, you have a literal translation of your runit system into a +s6 system, and it should boot, and work, albeit in a non-idiomatic, unoptimized way. +Further work to make it prettier can include: +

+ + + +

+ Colin Booth has a +series +of posts on Reddit that go into more detail on how to use a Void Linux distribution, +which natively uses runit, with the s6 ecosystem instead; there are step-by-step tutorials +as well as turnkey solutions, and it is recommended reading even if you do not use Void. +

+ -- cgit v1.2.3