mirror of
https://github.com/troglobit/finit.git
synced 2026-10-11 17:02:42 +07:00
Reference sections kept pointing at the line-based format they no longer
document. `sysv` and `task` sent the reader to Services for "<COND>",
the cgroups chapter opened by listing three legacy directives and then
explained further down that only two of them exist here, and the logging
chapter still gave "log:prio:facility.level,tag:ident" as the full
syntax.
Some claims were wrong independent of the format:
- a sysv is a supervised daemon, grouped with service in
SVC_TYPE_DAEMON, not a variation on task
- restart-max has no upper bound of 255, or any other
- the built-in rescue fallback runs in 12345789, not 12345
- conditional loading quotes system/10-hotplug.conf, not
system/hotplug.conf
- the key spells conflicts, not conflict
- the built-in getty no longer wants TERM last, it is a key
`if` takes either a service name or, in angle brackets, a condition,
decided in svc_ifthen(). Only the examples showed this, so it is now
said.
Terminology follows the split index.md already draws: a block is the new
format, a stanza the line-based one.
src/rescue.conf was still line-based, missed because it sits in src/
rather than system/ or contrib/.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
44 lines
1.4 KiB
Markdown
44 lines
1.4 KiB
Markdown
Templating
|
|
==========
|
|
|
|
Finit comes with rudimentary support for templating, similar to that of
|
|
systemd. Best illustrated with an example:
|
|
|
|
$ initctl show avahi-autoipd@
|
|
service avahi-autoipd:%i {
|
|
description = "ZeroConf for %i"
|
|
command = "avahi-autoipd --syslog %i"
|
|
}
|
|
|
|
To enable ZeroConf for, e.g., `eth0`, use
|
|
|
|
$ initctl enable avahi-autoipd@eth0.conf
|
|
|
|
The enabled symlink will be set up to `avahi-autoipd@.conf` and every
|
|
instance of `%i` will be replaced with `eth0` before the file is
|
|
parsed, so it works in the block title, in any value, and in the
|
|
command line alike. Inspect the result with `initctl show
|
|
avahi-autoipd:eth0`, and check a running instance with:
|
|
|
|
```
|
|
$ initctl status avahi-autoipd:eth0
|
|
Status : running
|
|
Identity : avahi-autoipd:eth0
|
|
Description : ZeroConf for eth0
|
|
Origin : /etc/finit.d/enabled/avahi-autoipd@eth0.conf
|
|
Environment : -/etc/default/avahi-autoipd-eth0
|
|
Command : avahi-autoipd $AVAHI_AUTOIPD_ARGS eth0
|
|
PID file : /run/avahi-autoipd.eth0.pid
|
|
PID : 4190
|
|
User : root
|
|
Group : root
|
|
Uptime : 24 sec
|
|
Restarts : 0 (0/10)
|
|
Runlevels : [---2345-789]
|
|
Memory : 20.0k
|
|
CGroup : /system/avahi-autoipd@eth0 cpu 0 [100, max] mem [0, max]
|
|
└─ 4190 avahi-autoipd: [eth0] bound 169.254.1.9
|
|
|
|
Jul 8 11:51:42 infix-c0-ff-ee finit[1]: Starting avahi-autoipd:eth0[4190]
|
|
```
|