System Management
Configuration
The system can be globally configured through the file /etc/s6/rc.conf
(encoded with venus-conf(5)):
hostname:eltanin-os
font{
default:default.ttf
mono:mono.ttf
}
s6{
init-flags:-1c
}
xkb{
model:pc105
layout:us
variant:
options:
rules:evdev
}
modules{
# modules to start at boot
}
It also can be used to configure services within services{}
.
services{
# "user" is a bundle to start on boot
user{
type:bundle
contents.d{
network
ntpd
}
}
network{
type:bundle
contents.d {
dhcpcd
wpa-supplicant
}
}
# set up each interface (see /etc/s6/sv/*.default.do for rules)
dhcpcd{
type:bundle
contents.d{
eth0.dhcpcd
wlan0.dhcpcd
}
}
wpa-supplicant{
type:bundle
contents.d{
wlan0.wpa-supplicant
}
}
# let's see how to write our own service "ntpd":
# bundle to act as "provides" from ntpd to openntpd
ntpd{
type:bundle
contents.d{
openntpd
}
}
openntpd{
type:longrun
dependencies.d{
network
}
command:ntpd -d
}
}
Redo
The redo utility is a key part of the system, serving as the engine behind both the venus package manager and the arbor build system. It is also used for generating files within the system. For that redo uses "do files" that are scripts akin to makefile rules:
- Running
redo ${target}
recreates the specified target by executing the corresponding${target}.do
file. - Running
redo-ifchange ${target}
recreates the specified target if necessary (i.e if the target or its dependencies have changed).
If no corresponding "do file" exists for a given target, redo looks for a special rule named default.do
. It searches upward from the target folder until it finds a default.do
or default.${extension}.do
file or reaches the redo root directory. You can use the redo-whichdo
command to see the searched path:
redo-whichdo dir/file.txt
dir/file.txt.do
dir/default.txt.do
dir/default.do
default.txt.do
default.do
System Rules
Directory | Rule | Purpose |
---|---|---|
/boot | default.initramfs.do | Build the initramfs |
/etc/s6/rc | compiled.do | Build the services database |
/etc/s6 | current.do | Build init scripts |
Note: It's currently important to enter the directory before executing the rule to maintain the database health. This is an implementation detail that is intended to be improved over time.
For example here is how you would build a new initramfs for the current kernel:
cd /boot
redo "$(uname -r).initramfs"
Services
The init system uses the supervision suite s6 plus s6-rc for service management.
Read more about s6
Read more about s6-rc
The services are stored under the /etc/s6/sv
directory, where files are rules and directories represent distinct services. The behavior of each service is defined by the contents of its corresponding directory.
The rules (or service build scripts) are meant to be executed indirectly, based on the service state defined in the /etc/s6/rc.conf
configuration file.
If you make changes to the service file hierarchy or the /etc/s6/rc.conf
file, you need to rebuild the database to apply the changes.