diff --git a/doc/conditions.md b/doc/conditions.md index 4da36b95..6d88333c 100644 --- a/doc/conditions.md +++ b/doc/conditions.md @@ -87,12 +87,15 @@ Static (one-shot) conditions, like `usr/`, never enter the `flux` state. Built-in Conditions ------------------- -Finit comes with a `pidfile` and `netlink` plugin. When enabled, the -`pidfile` plugin watches `/var/run/` (recursively) for PID files created -by the monitored services, and sets a corresponding condition in the -`pid/` namespace. Similarily, the `netlink` plugin provides basic -conditions for when an interface is brought up/down and when a default -route (gateway) is set, in the `net/` namespace. +Finit comes with a set of plugins for conditions: `pidfile`, `netlink`, +`sys`, and `usr`. The `pidfile` plugin (recursively) watches `/run/` +(recursively) for PID files created by the monitored services, and sets +a corresponding condition in the `pid/` namespace. Similarily, the +`netlink` plugin provides basic conditions for when an interface is +brought up/down and when a default route (gateway) is set, in the `net/` +namespace. The `sys` and `usr` plugins monitor are passive condition +monitors where the action is provided by `keventd`, signal handlers, +and in the case of `usr`, the end-user via the `initctl` tool With the example listed above, finit does not start the `/sbin/netd` daemon until `setupd` and `zebra` has started *and* created their PID @@ -111,6 +114,8 @@ Built-in conditions: - `net//exist` - `net//up` - `net//running` +- `sys/pwr/ac` +- `usr/foo` **Note:** `up` means administratively up, the interface flag `IFF_UP`. `running` is the `IFF_RUNNING` flag, meaning operatively up. The diff --git a/doc/config.md b/doc/config.md index c4a165ed..593fc0f7 100644 --- a/doc/config.md +++ b/doc/config.md @@ -26,6 +26,7 @@ Configuration * [/etc/finit.conf](#etcfinitconf) * [/etc/finit.d](#etcfinitd) * [Watchdog](#watchdog) +* [keventd](#keventd) Introduction @@ -704,3 +705,19 @@ the only option is to remove `/libexec/finit/watchdogd` or build without it at configure time. [bootstrap]: bootstrap.md + + +keventd +------- + +The kernel event daemon bundled with Finit is a simple uevent monitor +for `/sys/class/power_supply`. It provides the `sys/pwr/ac` condition, +which can be useful to prevent power hungry services like anacron to run +when a laptop is only running on battery, for instance. + +Since keventd is not an integral part of Finit yet it is not enabled by +default. Enable it using `./configuure --with-keventd`. The bundled +contrib build scripts for Debian, Alpine, and Void have this enabled. + +This daemon is planned to be extended with monitoring of other uevents, +patches and ideas are welcome in the issue tracker.