Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ad750a1
Bump version for 5.0 release cycle
troglobit Jul 30, 2026
ee5038e
test: reap the watchdog's sleep in wdkill()
troglobit Jul 25, 2026
fc74f87
conf: rename conf.c to legacy.c
troglobit Jul 25, 2026
3b866c9
conf: add libconfuse block format alongside the one-liner format
troglobit Jul 25, 2026
c20d645
conf: relocate global state from legacy parser
troglobit Jul 25, 2026
47a1814
conf: cleanup and relocation of common parsing functions and helpers
troglobit Jul 26, 2026
f1393ff
conf: instantiate %i templates for the block format
troglobit Jul 26, 2026
0721b0f
util: one whole-file reader for all tools
troglobit Jul 26, 2026
2a5190e
service: do not let a script timeout take PID 1 with it
troglobit Jul 26, 2026
53cb2b7
service: give stop and reload scripts their own timeout
troglobit Jul 26, 2026
8a3d55b
test: refuse to run against a stale sysroot binary
troglobit Jul 26, 2026
8a541ac
conf: settle the block format's key names and value shapes
troglobit Jul 26, 2026
f48f8aa
conf: replace the '!' condition prefix with reload-signal and required
troglobit Jul 27, 2026
13d58ac
conf: rename remain and manual for what they actually do
troglobit Jul 27, 2026
ddaef06
doc: rewrite sample.conf in the block format
troglobit Jul 28, 2026
ecac1e5
conf: make cgroup delegate and leaf name first-class keys
troglobit Jul 28, 2026
b9ad9bc
doc: convert the documentation to the block format
troglobit Jul 28, 2026
b44a5ff
contrib, system: convert the shipped .conf files to the block format
troglobit Jul 28, 2026
00794d4
doc: convert the remaining legacy syntax
troglobit Jul 28, 2026
ddda905
service: warn when capabilities cannot take effect
troglobit Jul 28, 2026
c584795
doc: fix back-references and stale claims left by the conversion
troglobit Jul 29, 2026
be28436
conf: drop the angle brackets from if, infer from the value
troglobit Jul 29, 2026
6615a24
service: return the svc from service_register()
troglobit Jul 29, 2026
7f8a64d
util: promote rmrf() from tmpfiles.c, fix silent mksubsys() skip
troglobit Jul 29, 2026
f0d7257
Fix #492: add per-service directories, systemd RuntimeDirectory style
troglobit Jul 29, 2026
6b03a1e
conf: adopt the systemd semantics for per-service directories
troglobit Jul 29, 2026
153f719
.github: install libconfuse-dev, mandatory since the new .conf format
troglobit Jul 30, 2026
301992b
doc: bare-ID services have no block equivalent
troglobit Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config tree jq libcap-dev
sudo apt-get -y install pkg-config
sudo apt-get -y install pkg-config tree jq libcap-dev libconfuse-dev
wget https://github.com/troglobit/libuev/releases/download/v2.4.1/libuev-2.4.1.tar.xz
wget https://github.com/troglobit/libite/releases/download/v2.6.2/libite-2.6.2.tar.gz
tar xf libuev-2.4.1.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config libcap-dev
sudo apt-get -y install pkg-config libcap-dev libconfuse-dev
wget https://github.com/troglobit/libuev/releases/download/v2.4.1/libuev-2.4.1.tar.xz
wget https://github.com/troglobit/libite/releases/download/v2.6.2/libite-2.6.2.tar.gz
tar xf libuev-2.4.1.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Installing dependencies ...
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config jq libcap-dev
sudo apt-get -y install pkg-config jq libcap-dev libconfuse-dev
wget https://github.com/troglobit/libuev/releases/download/v2.4.1/libuev-2.4.1.tar.xz
wget https://github.com/troglobit/libite/releases/download/v2.6.2/libite-2.6.2.tar.gz
tar xf libuev-2.4.1.tar.xz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install pkg-config jq libcap-dev
sudo apt-get -y install pkg-config jq libcap-dev libconfuse-dev
wget https://github.com/troglobit/libuev/releases/download/v2.4.1/libuev-2.4.1.tar.xz
wget https://github.com/troglobit/libite/releases/download/v2.6.2/libite-2.6.2.tar.gz
tar xf libuev-2.4.1.tar.xz
Expand Down
8 changes: 7 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([Finit], [4.17], [https://github.com/finit-project/finit/issues],
AC_INIT([Finit], [5.0-dev], [https://github.com/finit-project/finit/issues],
[finit], [https://http://finit-project.github.io/])
AC_CONFIG_AUX_DIR(aux)
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects])
Expand Down Expand Up @@ -50,6 +50,12 @@ PKG_PROG_PKG_CONFIG
# Check for required libraries
PKG_CHECK_MODULES([uev], [libuev >= 2.4.1])
PKG_CHECK_MODULES([lite], [libite >= 2.6.1])
# 3.3 is the floor: CFGF_KEYSTRVAL, which environment {} and the
# free-form cgroup keys are built on, does not exist before it. 3.3
# parses both correctly. Two workarounds hang off this number, the
# spurious KEYSTRVAL warning and cfg_parse_buf() losing the file name
# of a template; grep the XXX notes in src/conf.c before raising it.
PKG_CHECK_MODULES([confuse], [libconfuse >= 3.3])

# Check for configured Finit features
AC_ARG_ENABLE(auto_reload,
Expand Down
22 changes: 16 additions & 6 deletions contrib/alpine/finit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@

## Runlevel to start after bootstrap, runlevel 'S'
# Default is 2
#runlevel 2
#runlevel = 2

# Top-level cgroups and their default settings. All groups mandatory
# but more can be added, max 8 groups in total currently. The cgroup
# 'root' is also available, reserved for RT processes. Settings are
# as-is, only one shorthand 'mem.' exists, other than that it's the
# cgroup v2 controller default names.
#cgroup init cpu.weight:100
#cgroup user cpu.weight:100
#cgroup system cpu.weight:9700
#cgroup init { cpu.weight = 100 }
#cgroup user { cpu.weight = 100 }
#cgroup system { cpu.weight = 9700 }

# Task to run if ctrl-alt-del is pressed. This condition is asserted by
# Finit upon receiving SIGINT (from the kernel).
#task <sys/key/ctrlaltdel> [12345789] initctl reboot -- Rebooting system
#task reboot {
# description = "Rebooting system"
# runlevel = "12345789"
# conditions = { "sys/key/ctrlaltdel" }
# command = "initctl reboot"
#}

# Task to run if the kernel gets a power fail condition is pressed.
# Asserted by Finit upon receiving SIGPWR (from the kernel).
#task <sys/pwr/fail> [12345789] initctl poweroff -- Shutting down system
#task poweroff {
# description = "Shutting down system"
# runlevel = "12345789"
# conditions = { "sys/pwr/fail" }
# command = "initctl poweroff"
#}

## Bootstrap services and tasks
# Can be listed here or in /etc/finit.d/*.conf
8 changes: 7 additions & 1 deletion contrib/alpine/finit.d/available/acpid.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager)
# Depends on syslogd having started. Redirect any output to log.
service [2345] <pid/syslogd> log acpid -f -- ACPI daemon
service acpid {
description = "ACPI daemon"
runlevel = "2345"
conditions = { "pid/syslogd" }
log { }
command = "acpid -f"
}
8 changes: 7 additions & 1 deletion contrib/alpine/finit.d/available/crond.conf
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
service [2345] <pid/syslogd> env:-/etc/conf.d/crond crond -f -S $CRON_OPTS -- Cron daemon
service crond {
description = "Cron daemon"
runlevel = "2345"
conditions = { "pid/syslogd" }
envfile = "-/etc/conf.d/crond"
command = "crond -f -S $CRON_OPTS"
}
7 changes: 6 additions & 1 deletion contrib/alpine/finit.d/available/dropbear.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Start SSH daemon as soon as basic networking comes up
service [2345] env:-/etc/conf.d/dropbear dropbear -R -F $DROPBEAR_OPTS -- Dropbear SSH daemon
service dropbear {
description = "Dropbear SSH daemon"
runlevel = "2345"
envfile = "-/etc/conf.d/dropbear"
command = "dropbear -R -F $DROPBEAR_OPTS"
}
27 changes: 23 additions & 4 deletions contrib/alpine/finit.d/available/getty.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Consoles to start getty on when system is up
tty [12345] /dev/ttyS0 noclear
tty [12345] /dev/tty1 noclear nowait
tty [2345] /dev/tty2 noclear nowait
tty [2345] /dev/tty3 noclear nowait
tty ttyS0 {
runlevel = "12345"
device = "/dev/ttyS0"
noclear = true
}
tty tty1 {
runlevel = "12345"
device = "/dev/tty1"
noclear = true
nowait = true
}
tty tty2 {
runlevel = "2345"
device = "/dev/tty2"
noclear = true
nowait = true
}
tty tty3 {
runlevel = "2345"
device = "/dev/tty3"
noclear = true
nowait = true
}
7 changes: 6 additions & 1 deletion contrib/alpine/finit.d/available/keymap.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Oneshot task to run once at bootstrap
task [S] env:/etc/conf.d/loadkmap zcat $KEYMAP | loadkmap -- Loading keymap
task keymap {
description = "Loading keymap"
runlevel = "S"
envfile = "/etc/conf.d/loadkmap"
command = "zcat $KEYMAP | loadkmap"
}
6 changes: 5 additions & 1 deletion contrib/alpine/finit.d/available/lxdm.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
service [2345] lxdm -- Lightweight Login Manager
service lxdm {
description = "Lightweight Login Manager"
runlevel = "2345"
command = "lxdm"
}
7 changes: 1 addition & 6 deletions contrib/alpine/finit.d/available/modules.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
## Linux kernel modules to load
#module fbcon
#module button
#module evdev
#module mousedev
#module 8139cp
#module softdog
#modules = { "fbcon", "button", "evdev", "mousedev", "8139cp", "softdog" }
9 changes: 8 additions & 1 deletion contrib/alpine/finit.d/available/ntpd.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Busybox ntpd has no option to use syslog when running in foreground
service [2345] <pid/syslogd> env:-/etc/conf.d/ntpd log ntpd -n $NTPD_OPTS -- NTP daemon
service ntpd {
description = "NTP daemon"
runlevel = "2345"
conditions = { "pid/syslogd" }
envfile = "-/etc/conf.d/ntpd"
log { }
command = "ntpd -n $NTPD_OPTS"
}
15 changes: 13 additions & 2 deletions contrib/alpine/finit.d/available/syslogd.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Start syslogd as soon as possible, should always run
# Start klogd as soon as possible, but after syslogd
service [S12345] env:-/etc/conf.d/syslog syslogd -n $SYSLOGD_OPTS -- Syslog daemon
service [S12345] <pid/syslogd> env:-/etc/conf.d/klogd klogd -n $KLOGD_OPTS -- Kernel log daemon
service syslogd {
description = "Syslog daemon"
runlevel = "S12345"
envfile = "-/etc/conf.d/syslog"
command = "syslogd -n $SYSLOGD_OPTS"
}
service klogd {
description = "Kernel log daemon"
runlevel = "S12345"
conditions = { "pid/syslogd" }
envfile = "-/etc/conf.d/klogd"
command = "klogd -n $KLOGD_OPTS"
}
7 changes: 6 additions & 1 deletion contrib/alpine/finit.d/available/watchdog.conf
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
service [S123456789] env:-/etc/conf.d/watchdog watchdog $WATCHDOG_OPTS $WATCHDOG_DEV -- System watchdog
service watchdog {
description = "System watchdog"
runlevel = "S123456789"
envfile = "-/etc/conf.d/watchdog"
command = "watchdog $WATCHDOG_OPTS $WATCHDOG_DEV"
}
22 changes: 16 additions & 6 deletions contrib/debian/finit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@

## Runlevel to start after bootstrap, runlevel 'S'
# Default is 2
#runlevel 2
#runlevel = 2

# Top-level cgroups and their default settings. All groups mandatory
# but more can be added, max 8 groups in total currently. The cgroup
# 'root' is also available, reserved for RT processes. Settings are
# as-is, only one shorthand 'mem.' exists, other than that it's the
# cgroup v2 controller default names.
#cgroup init cpu.weight:100
#cgroup user cpu.weight:100
#cgroup system cpu.weight:9700
#cgroup init { cpu.weight = 100 }
#cgroup user { cpu.weight = 100 }
#cgroup system { cpu.weight = 9700 }

# Task to run if ctrl-alt-del is pressed. This condition is asserted by
# Finit upon receiving SIGINT (from the kernel).
#task <sys/key/ctrlaltdel> [12345789] initctl reboot -- Rebooting system
#task reboot {
# description = "Rebooting system"
# runlevel = "12345789"
# conditions = { "sys/key/ctrlaltdel" }
# command = "initctl reboot"
#}

# Task to run if the kernel gets a power fail condition is pressed.
# Asserted by Finit upon receiving SIGPWR (from the kernel).
#task <sys/pwr/fail> [12345789] initctl poweroff -- Shutting down system
#task poweroff {
# description = "Shutting down system"
# runlevel = "12345789"
# conditions = { "sys/pwr/fail" }
# command = "initctl poweroff"
#}

## Bootstrap services and tasks
# Can be listed here or in /etc/finit.d/*.conf
9 changes: 8 additions & 1 deletion contrib/debian/finit.d/available/acpid.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager)
# Depends on a syslog daemon having started. Redirect any output to log.
service [2345] <pid/syslogd> env:-/etc/default/acpid log acpid -f $OPTIONS -- ACPI daemon
service acpid {
description = "ACPI daemon"
runlevel = "2345"
conditions = { "pid/syslogd" }
envfile = "-/etc/default/acpid"
log { }
command = "acpid -f $OPTIONS"
}
9 changes: 8 additions & 1 deletion contrib/debian/finit.d/available/anacron.conf
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
task [2345] <sys/pwr/ac,pid/syslogd> halt:usr1 env:-/etc/default/anacron anacron -d -q $ANACRON_ARGS -- Anacron jobs
task anacron {
description = "Anacron jobs"
runlevel = "2345"
conditions = { "sys/pwr/ac", "pid/syslogd" }
envfile = "-/etc/default/anacron"
stop-signal = "usr1"
command = "anacron -d -q $ANACRON_ARGS"
}
6 changes: 5 additions & 1 deletion contrib/debian/finit.d/available/apparmor.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
sysv [S] /etc/init.d/apparmor -- AppArmor initialization
sysv apparmor {
description = "AppArmor initialization"
runlevel = "S"
command = "/etc/init.d/apparmor"
}

7 changes: 6 additions & 1 deletion contrib/debian/finit.d/available/avahi-daemon.conf
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
service [2345] env:-/etc/default/avahi-daemon avahi-daemon -s $AVAHI_DAEMON_OPTS -- Avahi mDNS/DNS-SD Stack
service avahi-daemon {
description = "Avahi mDNS/DNS-SD Stack"
runlevel = "2345"
envfile = "-/etc/default/avahi-daemon"
command = "avahi-daemon -s $AVAHI_DAEMON_OPTS"
}
8 changes: 7 additions & 1 deletion contrib/debian/finit.d/available/bluetooth.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# To ignore errors like "org.freedesktop.hostname1", update the env file with
# "--noplugin=hostname", i.e. append to BLUETOOTHD_OPTS
service [2345] log:null env:-/etc/default/bluetooth /usr/libexec/bluetooth/bluetoothd -n $BLUETOOTHD_OPTS -- Bluetooth service
service bluetoothd {
description = "Bluetooth service"
runlevel = "2345"
envfile = "-/etc/default/bluetooth"
log { file = "/dev/null" }
command = "/usr/libexec/bluetooth/bluetoothd -n $BLUETOOTHD_OPTS"
}
6 changes: 5 additions & 1 deletion contrib/debian/finit.d/available/console-setup.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Oneshot task to run once at bootstrap
task [S] /lib/console-setup/console-setup.sh -- Setting up console font and keymap
task console-setup {
description = "Setting up console font and keymap"
runlevel = "S"
command = "/lib/console-setup/console-setup.sh"
}
8 changes: 7 additions & 1 deletion contrib/debian/finit.d/available/cron.conf
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
service [2345] <sys/pwr/ac,pid/syslogd> env:-/etc/default/cron cron -f $EXTRA_OPTS -- Background job processing daemon
service cron {
description = "Background job processing daemon"
runlevel = "2345"
conditions = { "sys/pwr/ac", "pid/syslogd" }
envfile = "-/etc/default/cron"
command = "cron -f $EXTRA_OPTS"
}
7 changes: 6 additions & 1 deletion contrib/debian/finit.d/available/elogind.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# On some systems, bootstrap can be really quick and cause elogind
# to not start before a user has managed to log in. To prevent
# this, add <pid/elogind> as condition to your TTYs in getty.conf
service [2345] <pid/syslogd> /usr/libexec/elogind -- Login manager
service elogind {
description = "Login manager"
runlevel = "2345"
conditions = { "pid/syslogd" }
command = "/usr/libexec/elogind"
}
43 changes: 37 additions & 6 deletions contrib/debian/finit.d/available/getty.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
# Consoles to start getty on when system is up
tty [12345] /dev/tty1 linux noclear nowait
tty [2345] /dev/tty2 linux nowait
tty [2345] /dev/tty3 linux nowait
tty [2345] /dev/tty4 linux nowait
tty [2345] /dev/tty5 linux nowait
tty [2345] /dev/tty6 linux nowait
tty tty1 {
runlevel = "12345"
device = "/dev/tty1"
term = "linux"
noclear = true
nowait = true
}
tty tty2 {
runlevel = "2345"
device = "/dev/tty2"
term = "linux"
nowait = true
}
tty tty3 {
runlevel = "2345"
device = "/dev/tty3"
term = "linux"
nowait = true
}
tty tty4 {
runlevel = "2345"
device = "/dev/tty4"
term = "linux"
nowait = true
}
tty tty5 {
runlevel = "2345"
device = "/dev/tty5"
term = "linux"
nowait = true
}
tty tty6 {
runlevel = "2345"
device = "/dev/tty6"
term = "linux"
nowait = true
}
6 changes: 5 additions & 1 deletion contrib/debian/finit.d/available/keyboard-setup.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Oneshot task to run once at bootstrap
task [S] /lib/console-setup/keyboard-setup.sh -- Setting up console keyboard layout
task keyboard-setup {
description = "Setting up console keyboard layout"
runlevel = "S"
command = "/lib/console-setup/keyboard-setup.sh"
}
6 changes: 5 additions & 1 deletion contrib/debian/finit.d/available/lightdm.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
service [3] lightdm -- Light Display Manager
service lightdm {
description = "Light Display Manager"
runlevel = "3"
command = "lightdm"
}
Loading
Loading