doc/config.md: Update with changes to finit.conf and stanza limits

Finit v3.1 adds support for reloading /etc/finit.conf, document what
actually is read at runtime, compared to at bootstrap, and clarify
which stanzas are for what part of the boot process.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-12-29 20:52:43 +01:00
1 parent 3843f62aa8
commit c9a1a64ce5
1 file changed
+25 -19
+25 -19
View File
@@ -16,7 +16,7 @@ or in combination with `/etc/finit.d/*.conf`. Finit 3 can even start a
system using only `/etc/finit.d/*.conf`, highly useful for package-based system using only `/etc/finit.d/*.conf`, highly useful for package-based
Linux distributions -- each package can provide its own "script" file. Linux distributions -- each package can provide its own "script" file.
- `/etc/finit.conf`: main configuration file, read only once at boot - `/etc/finit.conf`: main configuration file
- `/etc/finit.d/*.conf`: snippets, usually one service per file - `/etc/finit.d/*.conf`: snippets, usually one service per file
Not all configuration directives are available in `/etc/finit.d/*.conf` Not all configuration directives are available in `/etc/finit.d/*.conf`
@@ -26,8 +26,10 @@ the section [Limitations](#limitations) below for details.
To add a new service, simply drop a `.conf` file in `/etc/finit.d` and To add a new service, simply drop a `.conf` file in `/etc/finit.d` and
run `initctl reload`. (It is also possible to `SIGHUP` to PID 1, or run `initctl reload`. (It is also possible to `SIGHUP` to PID 1, or
call `finit q`, but that has been deprecated with the `initctl` tool). call `finit q`, but that has been deprecated with the `initctl` tool).
Any service read from this directory is flagged as a dynamic service, so Finit monitors all known active `.conf` files, so if you want to force
changes to or removal of `/etc/finit.d/*.conf` files, is detected. a restart of any service you can simply touch its corresponding `.conf`
file in `/etc/finit.d` and call `initctl reload`. Finit handle any
and all conditions and dependencies between services automatically.
On `initctl reload` the following is checked for all services: On `initctl reload` the following is checked for all services:
@@ -143,12 +145,14 @@ Syntax
* `runparts <DIR>` * `runparts <DIR>`
Call [run-parts(8)][] on `DIR` to run start scripts. All executable Call [run-parts(8)][] on `DIR` to run start scripts. All executable
files, or scripts, in the directory are called, in alphabetic order. files, or scripts, in the directory are called, in alphabetic order.
The scripts in this directory are executed at the very end of runlevel
`S`, bootstrap.
It can be beneficial to use `S01name`, `S02othername`, etc. if there It can be beneficial to use `S01name`, `S02othername`, etc. if there
is a dependency order between the scripts. Symlinks to existing is a dependency order between the scripts. Symlinks to existing
daemons can talso be used, but make sure they daemonize by default. daemons can talso be used, but make sure they daemonize by default.
As the optional `/etc/rc.local` shell script, make sure that all your Similar to the `/etc/rc.local` shell script, make sure that all your
services and programs either terminate or start in the background or services and programs either terminate or start in the background or
you will block Finit. you will block Finit.
@@ -258,31 +262,33 @@ Limitations
To understand the limitations of `finit.conf` vs `finit.d` it is useful To understand the limitations of `finit.conf` vs `finit.d` it is useful
to picture the different phases of the system: bootstrap, runtime, and to picture the different phases of the system: bootstrap, runtime, and
shutdown. The `finit.conf` file can be used for all possible settings, shutdown.
but `finit.d/*.conf` can only be used for runtime settings.
### /etc/finit.conf ### /etc/finit.conf
This file was the only way to set up and boot a system using Finit. It This file used to be the only way to set up and boot a Finit system.
is used for pre-runtime settings like system hostname, network bringup Today it is mainly used for pre-runtime settings like system hostname,
and shutdown: network bringup and shutdown:
- `host` - `host`, only at bootstrap, (runlevel `S`)
- `mkdod` - `mknod`, only at bootstrap
- `network` - `network`, only at bootstrap
- `runparts` - `runparts`, only at bootstrap
- `include` - `include`
- `shtudown` - `shutdown`
- `runlevel` - `runlevel`, only at bootstrap
- ... and all configuration stanzas from `/etc/finit.d` below - ... and all configuration stanzas from `/etc/finit.d` below
### /etc/finit.d ### /etc/finit.d
Support for partial `.conf` files in `/etc/finit.d` was added to handle Support for per-service `.conf` files in `/etc/finit.d` was added in
changes of the system configuration at runtime. It does *not support* v3.0 to handle changes of the system configuration at runtime. As of
the above `finit.conf` settings described above, only the following: v3.1 `finit.conf` is also handled at runtime, except of course for any
stanza that only runs at bootstrap. However, a `/etc/finit.d/*.conf`
does *not support* the above `finit.conf` settings described above, only
the following:
- `module`, but only in runlevel `S` - `module`, but only at bootstrap
- `service` - `service`
- `task` - `task`
- `run` - `run`