mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 14:02:52 +07:00
This is what 'initctl create' and 'initctl edit -c' put in front of a user writing their first .conf file, so it is also the whole of the "initctl emits the new format" work: neither command generates syntax, they copy this file and open an editor on it. The ASCII diagram naming eight positional fields goes with it. A block has no positions to explain. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
89 lines
2.9 KiB
Plaintext
89 lines
2.9 KiB
Plaintext
# sample.conf: template run/task/service stanza for finit
|
|
#
|
|
# A .conf file is a series of blocks. Every setting is a key inside
|
|
# one, so nothing has to be memorised by position:
|
|
#
|
|
# service NAME {
|
|
# description = "What it is"
|
|
# runlevel = "2345" # default: 234
|
|
# conditions = { "net/lo/up" } # wait for these
|
|
# envfile = "-/etc/default/daemon"
|
|
# command = "/usr/sbin/daemon ARGS"
|
|
# }
|
|
#
|
|
# A leading '-' on a path means carry on if it is missing, so the
|
|
# envfile above is optional. Debian and Buildroot keep those files in
|
|
# /etc/default, Alpine in /etc/conf.d.
|
|
#
|
|
# There are four kinds of stanza:
|
|
#
|
|
# - run : one-shot, wait for it before continuing with the next
|
|
# - task : one-shot, started in parallel with the next
|
|
# - service : supervised daemon, run in foreground, restarted if it crashes
|
|
# - sysv : /etc/init.d style script, start/stop/restart
|
|
#
|
|
# The top-level cgroups can be defined anywhere, but share the same
|
|
# namespace. It is up to the user to ensure groups are defined only
|
|
# once, otherwise the last read .conf wins:
|
|
#
|
|
# cgroup NAME {
|
|
# cpu.weight = 1000
|
|
# memory.max = 65M
|
|
# }
|
|
#
|
|
# A service joins one by naming it, and may override settings for
|
|
# itself alone. Here foo and bar share the group foo, baz has its own:
|
|
#
|
|
# service foo { cgroup foo {} command = "foo args" }
|
|
# service bar { cgroup foo { cpu.weight = 150 } command = "bar args" }
|
|
# service baz { cgroup baz { cpu.weight = 300 } command = "baz args" }
|
|
|
|
# Debian GNU/Linux: start SSH daemon as soon as basic networking comes up
|
|
#service sshd {
|
|
# description = "OpenSSH daemon"
|
|
# runlevel = "2345"
|
|
# conditions = { "net/lo/up" }
|
|
# envfile = "-/etc/default/ssh"
|
|
# command = "/usr/sbin/sshd -D $SSHD_OPTS"
|
|
#}
|
|
|
|
# Alpine Linux: Oneshot task to run once at bootstrap, yes pipes are possible :)
|
|
#run kmap {
|
|
# description = "Loading keymap"
|
|
# runlevel = "S"
|
|
# envfile = "/etc/conf.d/loadkmap"
|
|
# command = "zcat $KEYMAP | loadkmap"
|
|
#}
|
|
|
|
# Alpine Linux: start SSH daemon with $DROPBEAR_OPTS from /etc/conf.d
|
|
#service dropbear {
|
|
# description = "Dropbear SSH daemon"
|
|
# runlevel = "2345"
|
|
# envfile = "-/etc/conf.d/dropbear"
|
|
# cgroup user {}
|
|
# command = "dropbear -R -F $DROPBEAR_OPTS"
|
|
#}
|
|
|
|
# Handle PWR button to shutdown/reboot -- useful in Qemu (virt-manager)
|
|
# Depends on syslogd having started. Redirect any output to the log.
|
|
#service acpid {
|
|
# description = "ACPI daemon"
|
|
# runlevel = "2345"
|
|
# conditions = { "pid/syslogd" }
|
|
# cgroup system {
|
|
# memory.max = 32M
|
|
# cpu.max = 1000
|
|
# }
|
|
# log { }
|
|
# command = "acpid -f"
|
|
#}
|
|
|
|
# Start rsyslogd as soon as possible, should always run
|
|
# Provides pid/syslogd condition
|
|
#service syslogd {
|
|
# description = "Reliable syslog daemon"
|
|
# runlevel = "S12345"
|
|
# envfile = "-/etc/default/rsyslog"
|
|
# command = "rsyslogd -n $RSYSLOGD_OPTIONS"
|
|
#}
|