mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
contrib, system: convert the shipped .conf files to the block format
The examples people copy from were still written in the line-based
format, so the block format was documented but nowhere demonstrated.
Two names in contrib were accidents of the old format, where the
service name falls out of the command basename: the Alpine and Void
keymap task was called zcat, and Debian's console/keyboard setup tasks
carried a .sh suffix. They now carry the name their file implies.
Nothing referenced the old names.
The mdevd coldplug path keeps the name it has always had. Its legacy
line spelled the name inside the cgroup argument, where it names the
cgroup leaf and not the service, so the barrier condition really is
<run/mdevd-coldplug/success> and not the <run/coldplug/success> the
comment above it promises. Converted as-is so boot ordering does not
change; the discrepancy is now written down where it happens.
A list may not contain comments, the lexer sees the entries after the
'#' regardless:
modules = {
# "fbcon",
"softdog"
}
so the commented-out module candidates sit above the list instead.
setup-sysroot.sh removes 10-hotplug.conf from the test sysroot, so that
file is covered by parsing only, not by make check.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
sysv [S] /etc/init.d/apparmor -- AppArmor initialization
|
||||
sysv apparmor {
|
||||
description = "AppArmor initialization"
|
||||
runlevel = "S"
|
||||
command = "/etc/init.d/apparmor"
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
service [3] lightdm -- Light Display Manager
|
||||
service lightdm {
|
||||
description = "Light Display Manager"
|
||||
runlevel = "3"
|
||||
command = "lightdm"
|
||||
}
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
## Linux kernel modules to load
|
||||
#module fbcon
|
||||
#module button
|
||||
#module evdev
|
||||
#module loop
|
||||
#module psmouse
|
||||
#module mousedev
|
||||
#module 8139cp
|
||||
#modules = { "fbcon", "button", "evdev", "loop", "psmouse", "mousedev", "8139cp" }
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
# Need to stop plymouth, or it'll block stdin on tty1
|
||||
task [S] /usr/bin/plymouth quit -- Stopping Plymouth Boot Screen
|
||||
task plymouth {
|
||||
description = "Stopping Plymouth Boot Screen"
|
||||
runlevel = "S"
|
||||
command = "/usr/bin/plymouth quit"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# Start rsyslogd as soon as possible, should always run
|
||||
# Provides pid/syslogd condition
|
||||
service [S12345] name:syslogd env:-/etc/default/rsyslog rsyslogd -n $RSYSLOGD_OPTIONS -- Reliable syslog daemon
|
||||
service syslogd {
|
||||
description = "Reliable syslog daemon"
|
||||
runlevel = "S12345"
|
||||
envfile = "-/etc/default/rsyslog"
|
||||
command = "rsyslogd -n $RSYSLOGD_OPTIONS"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,8 @@
|
||||
# Simple NTP client (SNTP)
|
||||
service [2345] <net/route/default> env:-/etc/default/sntpd sntpd -n $SNTPD_OPTIONS -- SNTP client
|
||||
service sntpd {
|
||||
description = "SNTP client"
|
||||
runlevel = "2345"
|
||||
conditions = { "net/route/default" }
|
||||
envfile = "-/etc/default/sntpd"
|
||||
command = "sntpd -n $SNTPD_OPTIONS"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,8 @@
|
||||
# Start SSH daemon as soon as basic networking comes up
|
||||
service [2345] <net/lo/up> env:-/etc/default/ssh /usr/sbin/sshd -D $SSHD_OPTS -- OpenSSH daemon
|
||||
service sshd {
|
||||
description = "OpenSSH daemon"
|
||||
runlevel = "2345"
|
||||
conditions = { "net/lo/up" }
|
||||
envfile = "-/etc/default/ssh"
|
||||
command = "/usr/sbin/sshd -D $SSHD_OPTS"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
# Start sysklogd as soon as possible, should always run if enabled
|
||||
service [S123456789] env:-/etc/default/syslogd syslogd -F $SYSLOGD_OPTIONS -- System logging daemon
|
||||
service syslogd {
|
||||
description = "System logging daemon"
|
||||
runlevel = "S123456789"
|
||||
envfile = "-/etc/default/syslogd"
|
||||
command = "syslogd -F $SYSLOGD_OPTIONS"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
# Here we use XDM since it has few dependencies (relatively speaking).
|
||||
# It is also an example of a service without a -- description.
|
||||
# service [3] lxdm -- Lightweight Login Manager
|
||||
service [3] xdm -nodaemon -- X Display Manager
|
||||
service xdm {
|
||||
description = "X Display Manager"
|
||||
runlevel = "3"
|
||||
command = "xdm -nodaemon"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user