Files
Joachim Wiberg 03a14bcaa5 Add <~cond> condition modifier for tightly coupled services
Conditions in Finit are dependencies: if A is asserted, service B is
allowed to run.  When A goes through FLUX (e.g., upstream reloads),
dependents are PAUSED and then simply resumed when the condition is
reasserted -- this is the correct behavior for barrier-style deps
like <pid/syslogd>.

However, some setups have tightly coupled services where dependents
must be reloaded/restarted when an upstream service reloads, not just
resumed.  E.g., the FRR routing stack on Infix OS:

    netd <pid/mgmtd> ← zebra <!pid/netd> ← {staticd,ripd} <!pid/zebra>

When netd reloads (SIGHUP), zebra and its dependents must be restarted
to pick up the new configuration.

The new '~' condition prefix marks a dependency as flux-sensitive:

    service <!~pid/netd> name:zebra ...

When the upstream condition goes FLUX and returns to ON, the dependent
is reloaded (SIGHUP) or restarted (noreload '!') instead of merely
resumed.  Transitivity follows naturally through the condition chain.

Closes #416
Closes #476

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-02-22 15:51:25 +01:00
..
2026-01-07 12:49:37 +01:00

This section provides an overview of Finit's configuration system. For detailed information on specific topics, see the individual sections in the navigation menu.

Configuration File Syntax

The file format is line based, empty lines and comments, lines starting with #, are ignored. A configuration directive starts with a keyword followed by a space and the rest of the line is treated as the value.

As of Finit v4.4, configuration directives can be broken up in multiple lines using the continuation character \, and trailing comments are also allowed. Example:

# Escape \# chars if you want them literal in, e.g., descriptions
service name:sysklogd [S123456789]   \
    env:-/etc/default/sysklogd       \
    syslogd -F $SYSLOGD_ARGS         \
    -- System log daemon \# 1   # Comments allowed

The .conf files /etc/finit.conf and /etc/finit.d/* support many directives. Some are restricted, e.g., only available at bootstrap, runlevel S. Read on in Files & Layout for more on how to structure your .conf files.

For details on restrictions, see Limitations.