Introduction to 66¶
The minimum you need to know to run an Obarun system. It is deliberately short. You do not have to read the whole 66 documentation before you can use your machine.
Services¶
A service is something 66 knows how to bring up and bring down. Services come in kinds:
- A oneshot runs once and finishes. Mounting a filesystem, setting the hostname, loading a keymap.
- A classic service is a long running process that 66 supervises. If it dies, it can be restarted without disturbing anything else, and its output is logged separately from everything else's.
- A module is a set of services packaged and configured as a unit. The boot sequence is one. See Modules.
A service is described by a frontend file, a small readable text file. The
distribution ships its own under /usr/share/66/service. Your own go in
/etc/66/service, or in ~/.66/service for user services. Files in /etc win
over files in /usr/share, so you customise by copying rather than by editing
in place.
Trees¶
A tree is a named set of services that belong together.
Say you use dhcpcd for your connection, wpa_supplicant for Wi-Fi, and a time
daemon to keep the clock right. Put the three in a tree called net, and one
command brings all three up or takes all three down. You can have it start at
every boot, or leave it off and start it when you actually need the network.
Trees are how you decide what a boot brings up, without editing anything global. See Trees.
Two trees exist without you creating them:
global, the default. A service enabled without naming a tree lands here.boot, created when the boot module is enabled. It holds what brings the machine up, and it belongs to thebootgroup, which 66 manages itself.
How the machine boots¶
The boot sequence sets the hostname, mounts /run, /proc, /sys, /dev and
the rest, reads the hardware clock, loads kernel modules, seeds the random
number generator, starts device management, assembles LVM or RAID volumes if you
asked for them, checks and mounts what /etc/fstab lists, remounts the root
filesystem read-write, sets up the consoles, and only then starts the services of
your other enabled trees.
Nearly all of that is one configurable unit, the boot module, usually named
boot@system. Its settings are plain key=value pairs. See
The boot module.
Two consequences worth knowing on day one:
- The bootloader can hand the kernel the root filesystem
roorrw, and 66 boots either way. The only difference is whether the root gets checked byfsckon the way up. See GRUB. tty@tty12is started early and always, as an emergency console, and root cannot log in on it. See Consoles and tty12.
What 66 leaves running¶
The commands you type are transient: 66 enable, 66 start, 66 configure do
their work and exit. The supervision is not, and that is the whole point of a
supervision suite. A supervisor that exited could not restart anything.
On a running machine you will find:
| Process | Role |
|---|---|
66-scandir |
PID 1. It is 66 that the kernel starts, and it holds the scandir for the life of the machine |
66-supervise |
One per supervised service. This is what notices a daemon died and brings it back |
66-log |
One per service that logs, plus the catch-all logger |
66-oneshotd |
Runs the oneshot services |
66-fdholderd |
Holds the file descriptors services pass around |
66-eventd |
The event daemon |
66-shutdownd |
Waits for a halt, reboot or poweroff request |
Look at them yourself:
They are small and they are the mechanism, not overhead. What 66 does not do is keep a general purpose manager resident to mediate everything else: outside supervision, nothing of 66 runs until you type a command.
One rule¶
Never delete 66's files by hand
66 maintains a structure of directories and state files. When a tree or a service misbehaves, it is tempting to go in and delete something. Do not.
Disable the service, or remove and recreate the tree, using the 66 commands.
66 -z tree status and 66 status tell you what is actually happening, and
66 log tells you why. If the output is unclear, ask on the
forum rather than guessing. Deleting files
turns a small problem into an inconsistent system.