antiX – runit – brief stop and onto s6 and 66 : How to

1st some history/background:
Back some time ago an alternative to sysvinit was developed called daemontools (look at sources below) and people liked it.   From “it” runit was cloned, very similar but started from scratch, to be as small, as light, as simple, and as responsive as hw itself.  Runit set some goals for its development, kept being refined and eliminating any bugs, it worked on as many architectures as people could get their hands on, and the chief runit man decided to put it to bed.  Runit has been frozen in time by its developer.  Don’t expect it to catch up with other system development unless Void decides to clone it and develop it on their own, which in some ways they already do, but it is more polishing up the existing runit.


While runit was running ahead, 9-10 years ago, s6 (and a few others) took different aims based on the same daemontool idea. Runit was being overly simplistic and therefore limited, s6 was designed not to just handle the needs of a pc or a pocket device but be able to handle the complexities of the largest machines conceived (I think) as well as any small machine/system.  While runit was placed to rest, it is being kept alive and polished by Void, s6 keeps on maturing.  I believe it is nearing 10y in development. The two are like comparing a 70s local race car to a 24hr LeMans racer of the future.  And there are those that would prefer for their fun and games to maintain a 70s race car.  Systemd is your mom’s minivan …. if you were ready to ask!  Unsafe at any speed, which isn’t much to begin with.

66 is the management front for s6 that works for common mortals. Using s6 out of the box (from skarnet not debian) requires much previous knowledge and some more studying of s6. It is not a plug and play system. 66 makes it plug and play.  Still some initial study on how to operate this is necessary, but not much.  Think of 1/100 of what it would take to run s6 without 66.  I don’t think the s6 developer Laurent Bercot would really disagree with this statement.  He has never really bragged or advertised his creation, but now that he has joined Adelie-Linux, he may be forced to come out of the closet and help people enjoy his work.

So with the courage that antiX developer provided (to publish a runit-antiX iso) and with admitted little investigation of it, I undertook the task of converting an antiX-19-runit installation to s6 and 66. I also had the faith it would work since the 66 developer/s would get a quick success from trying it (adelie, void, alpine, funtoo, devuan) and since 66 is native in void now, I had succeeded in void myself.  But debian is a very different monster.  The people in void, bound by their own principles, of respecting and porting software to their huge distribution (9 architectures x 2 C libraries = 18 distributions?).  Debian in their casual way can split, bundle, twist, and deform software to their liking.  In this case they seem to make an effort  to discredit s6 by intentionally preventing it from working as they placed it in repositories.  Surprised?  No, not me!  I’ve seen it all, that’s why I made this site, so “we” can talk about what we’ve seen.

The first mistake was not to study antiX-runit as closely. I realized right away that it was not like void and didn’t spend time to see how it actually worked (with sysvinit on its side – that’s how you dummy!).

Basically you get the installation running, as you want it to, and then exit and work from chroot. This helps if you don’t want to risk crash reboot/shutdown since what is doing this properly will not be there and what replaces it will not work with the old system in memory. So there would be a chance of corrupting data on all mounted volumes when you just pull the plug on it (sort of speak) – edit: there is a command below in courtesy of Eric Vidal himself on how to reboot if you are on a running system and not on chroot.  It is just me, anything I do on a system I do it from inside Obarun … I am addicted ..  I thought I would move to Void on a daily basis after I got s6/66 to work just as well there, but here I am …  right now, typing all this from Obarun. 

The one way is to begin by struggling to make what is on debian as s6, and removing runit/sysvinit.
The other way (suggested by the 66 developer) is to leave things as they are and just replace /usr/bin/init after you installed the proper software.  You know, like how MX deals with systemd and leaves it in there DEAD as it deserves to be :).

Debian has first incorporated execline in a different place than it was designed to work by skarnet, so s6-rc can’t work.   s6-rc works on many other systems, not on Debian.  I guess if Debianers were to rewrite it and tell it where execline tools are hidden it would work, but why bother?  They never meant it to be working, they are just showing off that they are “open to other init systems”.  ….  I know, I am not paying your salary, IBM is.  Ok!  End of rational debating and back to reality.

Also, s6 on buster and testing is 2 versions back, the real current software is 2.9 not 2.7 and it is only on sid, still incomplete and wrongfully packaged. You can install it (from sid) and take all its tools and move them/copy them to /usr/bin/. Then the s6 skarnet libraries are not completely adopted, s6-linux-utils netw..-utils, etc. have been left out. So here is a set of instructions on how to properly install the real software from skarnet and obarun (66) into your antix. After having some minor issues the 66 developer (Eric Vidal) came to rescue me and here is what he advised as a complete procedure:

– update and install git with apt (if it is not there already, I don’t remember)

Note: % (user) # (root)

Note2:  Apologies to anticapitalista, there were a couple of address errors on the original and it is now corrected.

% cd /tmp
% git clone https://github.com/skarnet/skalibs
% git clone https://github.com/skarnet/execline
% git clone https://github.com/skarnet/s6
% git clone https://github.com/skarnet/s6-rc
% git clone https://github.com/skarnet/s6-linux-utils
% git clone https://github.com/skarnet/s6-portable-utils
% git clone https://framagit.org/obarun/oblibs
% git clone https://framagit.org/obarun/66
% git clone https://framagit.org/obarun/66-tools
% git clone https://framagit.org/obarun/boot-66serv
% git clone https://framagit.org/pkg/observice/tty_instance-66serv

% cd /tmp/skalibs
% ./configure –bindir=/usr/bin
% sudo make install

% cd /tmp/execline
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs
% sudo make install

% cd /tmp/s6
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs –with-lib=/usr/lib/execline
% sudo make install

% cd /tmp/s6-rc
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs –with-lib=/usr/lib/execline –with-lib=/usr/lib/s6
% sudo make install

% cd /tmp/s6-linux-utils
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs
% sudo make install

% cd /tmp/s6-portable-utils
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs
% sudo make install

% cd /tmp/oblibs
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs –with-lib=/usr/lib/execline
% sudo make install

% cd /tmp/66
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs –with-lib=/usr/lib/execline –with-% lib=/usr/lib/s6 –with-lib=/usr/lib/s6-rc –with-lib=/usr/lib/oblibs
% sudo make install

% cd /tmp/66-tools
% ./configure –bindir=/usr/bin –with-lib=/usr/lib/skalibs –with-lib=/usr/lib/execline –with-lib=/usr/lib/oblibs
% sudo make install

% cd /tmp/boot-66serv
% ./configure –bindir=/usr/bin –HOSTNAME=66 –TZ=Europe/Sofia –KEYMAP=’!us’
% sudo make install

% cd /tmp/
% sudo cp tty_instance-66serv/trunk/tty@ /usr/share/66/service

Now you are ready to configure the system:

– Edit the /etc/66/init file and add the -m option to 66-boot as:

#!/usr/bin/execlineb -P
66-boot -m

This mounts the /run directory as rw which is necessary for debian.

Make copies of skeleton files at /usr/sbin (debian use /usr/sbin)

# cp -f /etc/66/{init,reboot,poweroff,shutdown,halt} /usr/sbin

There is a tree of services that are needed to boot the system (mount file systems, checks fs, set hostname, devices, etc.) that are all inside the boot-66serv. You simply create a tree (bundle of services) named boot and enable the boot bundle in it as a single service.

# 66-tree -n boot
# 66-enable -t boot boot

Then you create at least one tree, by convention it is called root, and enable ttys and services dhcpcd, dbus, wpa_supplicant etc.

# 66-tree -cnE root
# 66-enable tty@tty{1,2,3,4,5} dhcpcd .. etc.

dhcpcd works out of the box as it is in obarun, dbus needs some editing of dbus syntax as used on antix, slim (if you want to run it) I have a copy of a service file below that should work. Anything else you have to see the template of a service and write one. Anything that is already made is on https://framagit.org/pkg/observice

You are done you can now boot if you are on chroot or you can try to reboot with this command below:

# 66-hpr -r -f

Extra configuration

create the slim service at /usr/share/66/service/slim. This is frontend :

[main]
@type = classic
@description = "slim daemon"
@user = ( root )

[start]
@build = auto
@execute = (slim -d)

enable it

# 66-enable slim

For how and why things work the way they do see the wiki at obarun (last link).

Sources:
http://cr.yp.to/daemontools.html
http://smarden.org/runit/
https://skarnet.org/software/s6/
https://web.obarun.org/software
https://wiki.obarun.org/doku.php?id=66intro

PS: This should work equally on devuan, mx, or anything debian based, but it is meant for antiX which is truly a non-systemd distribution and not something of a gray shade.

PS2: As s6 and 66 is not handled by apt don’t expect it to magically be upgraded when new editions come out, so keep an eye on framagit for 66 and github/skarnet for s6 updates. If you knew nothing about init and service supervision before this, give 66 a couple of weeks and it will all make sense. If you do know about them, good for you! Tell us how it compares.

PS3: Will this work on an antiX live system? I don’t know yet, you tell me or I’ll tell you when I try it.

PS4: This is all written in C and is meant to be portable anywhere and this far it seems to be. Void has as many or more architectures it supports and two different C libraries (gnu and musl) and all their software is crosslinked to work on all combinations. Debian twisted and scraped s6 around and didn’t even apply it to all architectures, which are all glibc. Arch is all amd64 and glibc, nothing else. It is good to keep such things in mind … you can like manjaro and mint all you want but what have they contributed to development?

PS5 (final): Expect computer scientists and mathematicians in universities to really appreciate s6 and 66. Expect state agency executives and large corporations to continue liking systemd “and keep using the irrational argument” <systemd is better than sysvinit> as an excuse. The future is here!

13 thoughts on “antiX – runit – brief stop and onto s6 and 66 : How to

  1. Some of us feel the 666 is a bad sign… I don’t understand the unix-y reasons behind it, so it does seem gratuitous. I’m sure it is way better than systemD, which is more than a bad omen; it is now such a dependency, and we all know how dependencies can be exploited!

    Like

  2. 66 is different than 666.
    As being said, if you look at the current world, the bad become the good and the good become the bad whatever the subject taken.
    If systemd become the god, i prefer to be the devil… 😉

    Liked by 1 person

If your comment is considered off-topic a new topic will be created with your comment to continue a different discussion. This community is based on open and free communication, meaning we must all respect all in minimizing the exercise of freedom to disrupt such communication. Feel free to post what you think but keep in mind the subject matter discussed. It is just as easy to start a new topic as it is to dilute the content of an existing discussion.

This site uses Akismet to reduce spam. Learn how your comment data is processed.