mirror of
https://github.com/troglobit/finit.git
synced 2026-11-02 13:20:32 +00:00
doc: convert the documentation to the block format
The syntax overview no longer describes a line-based format, since that is not what the rest of the documentation shows. It now covers the grammar, the two naming conventions, the nine aliases, and the leading '-' on a path, and it says plainly that both formats are still read and told apart per file by content. Without that, a reader with an existing configuration is left wondering what happened to it. service-opts.md was a list of modifiers to place between a directive and its command, so it needed rewriting rather than translating: there are no positions left to describe. It is now grouped by what the settings do. conditions.md needed correcting. It presented '!' as a condition prefix alongside '~'. It is neither a condition nor a negation, it is a flag on the block that means one thing on a service and another on a run or task, so it is spelled reload-signal and required here, and the page maps the old form to both. Two things the pages claimed are not true. The kill delay range is 1-300, not 1-60, and stop and reload scripts are no longer run without a timeout. ChangeLog.md keeps its line-based examples. Those sit in historical release entries, and rewriting them in a syntax that did not exist at the time would misdate the format. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
20 files changed
+790
-352
No files matched your search
+44
-8
@@ -19,7 +19,13 @@ The default baud rate is 0, i.e., keep kernel default.
|
||||
|
||||
**Example:**
|
||||
|
||||
tty [12345] /dev/ttyAMA0 115200 noclear vt220
|
||||
tty ttyAMA0 {
|
||||
runlevel = "12345"
|
||||
device = "/dev/ttyAMA0"
|
||||
baud = 115200
|
||||
term = "vt220"
|
||||
noclear = true
|
||||
}
|
||||
|
||||
The second `tty` syntax variant is for using an external getty, like
|
||||
agetty or the BusyBox getty.
|
||||
@@ -38,8 +44,16 @@ the user to press enter before starting getty.
|
||||
|
||||
**Example:**
|
||||
|
||||
tty [12345] /sbin/getty -L 115200 /dev/ttyAMA0 vt100
|
||||
tty [12345] /sbin/agetty -L ttyAMA0 115200 vt100 nowait
|
||||
tty getty {
|
||||
runlevel = "12345"
|
||||
command = "/sbin/getty -L 115200 /dev/ttyAMA0 vt100"
|
||||
}
|
||||
|
||||
tty agetty {
|
||||
runlevel = "12345"
|
||||
command = "/sbin/agetty -L ttyAMA0 115200 vt100"
|
||||
nowait = true
|
||||
}
|
||||
|
||||
The `noclear` option disables clearing the TTY after each session.
|
||||
Clearing the TTY when a user logs out is usually preferable.
|
||||
@@ -69,13 +83,21 @@ can be omitted to keep the kernel default.
|
||||
|
||||
**Example:**
|
||||
|
||||
tty [12345] @console noclear vt220
|
||||
tty console {
|
||||
runlevel = "12345"
|
||||
device = "@console"
|
||||
term = "vt220"
|
||||
noclear = true
|
||||
}
|
||||
|
||||
On really bare bones systems, or for board bringup, Finit can give you a
|
||||
shell prompt as soon as bootstrap is done, without opening any device
|
||||
node:
|
||||
|
||||
tty [12345789] notty
|
||||
tty board {
|
||||
runlevel = "12345789"
|
||||
notty = true
|
||||
}
|
||||
|
||||
This should of course not be enabled on production systems. Because it
|
||||
may give a user root access without having to log in. However, for
|
||||
@@ -83,7 +105,10 @@ board bringup and system debugging it can come in handy.
|
||||
|
||||
One can also use the `service` stanza to start a stand-alone shell:
|
||||
|
||||
service [12345] /bin/sh -l
|
||||
service shell {
|
||||
runlevel = "12345"
|
||||
command = "/bin/sh -l"
|
||||
}
|
||||
|
||||
Controlling TTY for Services
|
||||
----------------------------
|
||||
@@ -109,5 +134,16 @@ TTY device.
|
||||
|
||||
**Example:**
|
||||
|
||||
service [2345] tty:/dev/ttyS0 /usr/sbin/foo -- Foo on serial console
|
||||
task [S] tty:@console my-setup-script -- Board bringup on console
|
||||
service foo {
|
||||
description = "Foo on serial console"
|
||||
runlevel = "2345"
|
||||
tty = "/dev/ttyS0"
|
||||
command = "/usr/sbin/foo"
|
||||
}
|
||||
|
||||
task setup {
|
||||
description = "Board bringup on console"
|
||||
runlevel = "S"
|
||||
tty = "@console"
|
||||
command = "my-setup-script"
|
||||
}
|
||||
Reference in new issue
Block a user