mirror of
https://github.com/troglobit/finit.git
synced 2026-10-22 11:36:07 +00: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>
53 lines
2.1 KiB
Markdown
53 lines
2.1 KiB
Markdown
Run-parts Scripts
|
|
-----------------
|
|
|
|
**Syntax:** `runparts = "DIR"`
|
|
|
|
Call [run-parts(8)][] on `DIR` to run start scripts. All executable
|
|
files in the directory are called, in alphabetic order. The scripts in
|
|
this directory are executed at the very end of runlevel `S`.
|
|
|
|
A common use-case for runparts scripts is to create and enable/disable
|
|
services, which Finit will then apply when changing runlevel from S to
|
|
whatever the next runlevel is set to be (default 2). E.g., generate a
|
|
`/etc/chrony.conf` and call `initctl enable chronyd`.
|
|
|
|
**Options:**
|
|
|
|
- `runparts-progress = true`: display the progress of each script being
|
|
executed
|
|
- `runparts-sysv = true`: run only SysV style scripts, i.e., `SNNfoo`,
|
|
or `KNNbar`, where `NN` is a number (0-99).
|
|
|
|
If global debug mode is enabled, the `runparts` program is also called
|
|
with the debug flag.
|
|
|
|
**Limitations:**
|
|
|
|
Scripts called from `runparts`, or hook scripts (see below), are limited
|
|
in their interaction with Finit. Like a standalone `run` block and
|
|
the `/etc/rc.local` shell script, Finit waits for their completion
|
|
before continuing. None of them can issue commands to start, stop, or
|
|
restart other services. Also, ensure all your services and programs
|
|
either terminate or start in the background or you will block Finit.
|
|
|
|
> [!NOTE]
|
|
> `runparts` scripts are only read and executed in runlevel S. See
|
|
> [hook scripts](../plugins.md#hooks) for other ways to run scripts at
|
|
> certain points during the complete lifetime of the system.
|
|
|
|
**Recommendations:**
|
|
|
|
It can be beneficial to use `01-name`, `02-othername`, etc., to ensure
|
|
the scripts are started in that order, e.g., if there is a dependency
|
|
order between scripts. Symlinks to existing daemons can also be used,
|
|
but make sure they daemonize (background) themselves properly, otherwise
|
|
Finit will lock up.
|
|
|
|
If `S[0-9]foo` and `K[0-9]bar` style naming is used, the executable will
|
|
be called with an extra argument, `start` and `stop`, respectively.
|
|
E.g., `S01foo` will be called as `S01foo start`. Of course, `S01foo`
|
|
and `K01foo` may be a symlink to `another/directory/foo`.
|
|
|
|
[run-parts(8)]: http://manpages.debian.org/cgi-bin/man.cgi?query=run-parts
|