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,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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
service [2345] lxdm -- Lightweight Login Manager
|
||||
service lxdm {
|
||||
description = "Lightweight Login Manager"
|
||||
runlevel = "2345"
|
||||
command = "lxdm"
|
||||
}
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user