The goal of this topic is to try out the s6-66 Service Manager.
I chose to do this in Antix. I used
antiX-23.1_amd64_init-diversity-edition_UNOFFICIAL_20240302.iso
installed in a VM under virt-manager.
Antix may not be familiar to some users - it is a Debian based distro and is one of the foundations of the popular MX distro.
Antix , by default comes with a selection of window managers ( you can add a DE). I am happy with IceWM
so I am leaving it at that.
Here is what Antix looks like booted with s6-66 and with IceWM
The terminal shows the s6-svscan init process and the s6-supervise processes. The init and supervision part of S6 is the same for s6-rc and s6-66; only the service manager differs.
I started by asking a few questions… here is the essence of it, transferred from another topic
Q:
Is 66 a complete alternative to s6-rc or is it built on top of it
A:
It used to be a wrapper for s6-rc, but the new version (0.7.0.0) is a full re-write totally independent.
If you have Obarun it still uses the old wrapper version of 66 (until the new Obarun release is out), my antiX/MX/Devuan respins feature the brand new independent version.
The latest release of 66 is 0.7.0.0 and is found here
For those unfamiliar, Obaron is a Linux distro which features s6 as its default init system.
@ProwlerGr also volunteered the folowing
https://web.obarun.org/software/66/latest/66-rosetta.html
The command used do everything in s6-66 is 66
… that is right, a
number is a valid command in Linux!
Previous versions of 66 had commands like 66-start ...
, but the latest version has changed to 66 start ...
. So start
is a subcommand.
The full manpage for the 66
command is here
https://web.obarun.org/software/66/latest/66.html
and the only other available documentation is the Oberun Wiki
http://wiki.obarun.org/doku.php?id=66.2
which seems to be inaccessible at the moment.
You may gather that in s6-66 we are dealing with a very new product that is still evolving.
Lets have a look and see what is in the s6-66 filesystems
$ ls /etc/66
conf rc.init rc.shutdown seed
environment rc.init.container rc.shutdown.final service
init.conf rc.local s6-66-init
nevj@antix-init-diversity:/etc/66
$ ls conf
bluetoothd boot@system
nevj@antix-init-diversity:/etc/66
$ ls environment
path
nevj@antix-init-diversity:/etc/66
$ ls service
bluetoothd dbus NetworkManager slimski ubus wpa-supplicant
boot@system dhcpcd nmbd smbd ufw xrdp
connmand elogind seatd sshd user xrdp-sesman
So there is a directory called 66
in /etc , and it contains various directories and files, including a dir called service
. The files in the service subdir seem to be scripts, eg
$ cat dbus
[main]
@type=classic
@description="dbus daemon"
@version=0.0.1
@user=(root)
@notify=3
[start]
@execute=(
execl-toc -d /run/dbus -m0755 -g 81 -o 81
foreground { dbus-uuidgen --ensure }
/usr/bin/dbus-daemon --system --nofork --nopidfile --print-pid=3
)
That seems to be some sort of run script for the dbus daemon.
I found this
By default, 66 use execline as scripting language. However, you can specify the scripting language to use. 66-tools provide some additonal tools to help you on this task. Some are specific to execline where other can be used on classic shell.
So that is an execline script ( like in s6-rc) but one can use other types of script.
You will notice a directory called boot@system
. It contains the following
nevj@antix-init-diversity:/etc/66/service
$ ls boot@system
activated configure frontend
nevj@antix-init-diversity:/etc/66/service
$ cd boot@system
nevj@antix-init-diversity:/etc/66/service/boot@system
$ ls activated
depends mount-pts populate-sys system-sysctl
local-authfiles mount-run populate-tmp tty-earlier@tty12
local-dmesg mount-shm requiredby tty-rc@tty1
local-loop mount-swap system-fontnkey tty-rc@tty2
local-sethostname mount-tmp system-hostname udevd
local-time populate-dev system-hwclock
mount-cgroups populate-run system-random
boot@system
is the default bundle… only it is not called a bundle in s6-66 it is called a tree
.
I have no idea how a tree differs from a bundle, but they both tie multiple daemons into a group that can be managed with one command.
You can see the contents of boot@system are basic system daemons needed at startup.
Now might be a good time to echo the warning
Do not edit any of the `66` files. Always use the `66` commands
So it is OK to look, like we have been doing, but dont change any files by hand.
There are other 66
related files in /usr/lib/s6-66, /usr/share/66 and in /var/run/66.
Now let us try and use the 66 command
# 66 status seatd
Name : seatd
Version : 0.0.1
In tree : global
Status : enabled, up (pid 916) 4377 seconds
Type : classic
Description : seatd daemon
Part of : None
Notify : 0
Max death : 5
Earlier : 0
Source : /etc/66/service/seatd
Live : /run/66/scandir/0/seatd
Dependencies : seatd-log
Required by : slimski
Contents : None
Optional dependencies : None
Start script :
#!/usr/lib/execline/bin/execlineb -P
/usr/lib/execline/bin/fdmove -c 2 1
/usr/sbin/seatd
Stop script :
None
Environment source : None
Environment file : None
Log name : seatd-log
Log destination : /var/log/66/seatd
Log file :
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
00:07:41.807 [INFO] [seatd/seatd.c:218] seatd stopped
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
00:04:55.152 [INFO] [seatd/seatd.c:218] seatd stopped
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
00:18:33.714 [INFO] [seatd/seatd.c:218] seatd stopped
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
00:05:42.310 [INFO] [seatd/seatd.c:218] seatd stopped
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
It says seatd is enabled ( ie will start at boot) and up, with a lot of verbosity.
Notice it knows about dependencies. S6 handles dependencies among daemons ( runit does not handle dependencies).
Let us now find a daemon that is not running and see if we can start it. Will try sshd
# 66 status sshd
status: fatal: service: sshd is not parsed -- try to parse it using '66 parse sshd'
I think that means it is simply not running, because it is installed
# dpkg -l | grep ssh
ii openssh-client 1:9.2p1-2.0nosystemd1 amd64 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:9.2p1-2.0nosystemd1 amd64 secure shell (SSH) server, for secure access from remote machines
ii openssh-sftp-server 1:9.2p1-2.0nosystemd1 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
Yes it is installed.
So we should be able to start it
# 66 start sshd
parse: fatal: unable to parse file of service: sshd
No such luck.
Obviously I need to do something else with sshd first… maybe it does not have a run script?
No, there is an sshd
file in /etc/66/service
and it contains a run script.
Service files are documented here
https://web.obarun.org/software/66/latest/66-frontend.html
but I can not find anything about what to do to start a service?