From 647a79ffbda14a9a101b4636aafe950753e3a305 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 8 Mar 2017 16:09:40 +0100 Subject: [PATCH] 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 --- README.md | 24 +++++++++++++++++++++--- doc/config.md | 7 +++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d69cfa46..efbad9d2 100644 --- a/README.md +++ b/README.md @@ -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] /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. diff --git a/doc/config.md b/doc/config.md index 498551ef..188f1e14 100644 --- a/doc/config.md +++ b/doc/config.md @@ -76,6 +76,13 @@ Syntax: service [2345] /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.