README: Add explanation of service early and link to doc/config.md

Also, update the service help text in doc/config.md to include info on
both runlevels and explain the condition in the listed example.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-03-08 16:09:40 +01:00
parent 47793dcdf2
commit 647a79ffbd
2 changed files with 28 additions and 3 deletions
+21 -3
View File
@@ -43,9 +43,9 @@ entirely in C.
Configuration is read from [/etc/finit.conf](doc/config.md#etcfinitconf)
which details kernel modules to load, services and TTYs to start. When
initial [bootstrap](doc/bootstrap.md) is done, including setting up
networking, [/etc/finit.d/](doc/config.md#etcfinitd) and the familiar
[/etc/rc.local](#runparts--etcrclocal) are run.
the initial [bootstrap](doc/bootstrap.md) is done, including setting up
networking, all services in [/etc/finit.d/](doc/config.md#etcfinitd) and
the familiar [/etc/rc.local](#runparts--etcrclocal) are started.
**Example /etc/finit.conf:**
@@ -91,6 +91,24 @@ networking, [/etc/finit.d/](doc/config.md#etcfinitd) and the familiar
tty [12345] /dev/ttyAMA0 115200 vt100
```
The `service` stanza, described in full in [config.md][doc/config.md],
has the following components:
```
service [LVLS] <COND> /path/to/daemon ARGS -- Some text
^ ^ ^ ^ ^ ^
| | | | | `-- Optional description
| | | | `---------- Daemon arguments
| | | `-------------------------- Path to daemon
| | `--------------------------------- Optional conditions
| `---------------------------------------- Optional Runlevels
`------------------------------------------------ Monitored application
```
Many of the components are optional. What is required, however, is for the
daemon *not to fork* to and detach itself. This is usually an `-n` or `-f`
argument to the application.
For an example of a full blown embedded Linux, see [TroglOS][9], or take
a look at the `contrib/` section with [Alpine Linux](contrib/alpine/),
[Debian](contrib/debian/), support and more.
+7
View File
@@ -76,6 +76,13 @@ Syntax:
service [2345] <svc/sbin/zebra> /sbin/ospfd -- OSPF daemon
```
The `[2345]` is the runlevels `ospfd` is allowed to run in, they are
optional and default to level 2-5 if left out.
The `<...>` is the condition for starting `ospfd`. In this example
Finit waits for another service, `/sbin/zebra`, to have created its
PID file in `/var/run/zebra.pid` before starting `ospfd`.
For a detailed description of conditions, and how to debug them,
see the [Finit Conditions](conditions.md) document.