From 3acf00a5a4ff656e2799f7f3e2544891b09bbc35 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 23 Feb 2021 14:07:46 +0100 Subject: man: various improvements to systemd.generator(7) In particular, make clear the .d/*.conf unit file drop-ins are OK to generate from generators. Inspired by: https://lists.freedesktop.org/archives/systemd-devel/2021-February/046148.html --- man/systemd.generator.xml | 49 ++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) (limited to 'man') diff --git a/man/systemd.generator.xml b/man/systemd.generator.xml index b1936bed4d..9c622ed44c 100644 --- a/man/systemd.generator.xml +++ b/man/systemd.generator.xml @@ -47,12 +47,13 @@ Description - Generators are small executables that live in - &systemgeneratordir;/ and other directories listed above. - systemd1 - will execute those binaries very early at bootup and at configuration reload time - — before unit files are loaded. Their main purpose is to convert configuration - that is not native into dynamically generated unit files. + Generators are small executables placed in &systemgeneratordir;/ and other + directories listed above. + systemd1 will execute + these binaries very early at bootup and at configuration reload time — before unit files are + loaded. Their main purpose is to convert configuration that is not native to the service manager into + dynamically generated unit files, symlinks or unit file drop-ins, so that they can extend the unit file + hierarchy the service manager subsequently loads and operates on. Each generator is called with three directory paths that are to be used for generator output. In these three directories, generators may dynamically generate @@ -155,17 +156,15 @@ - Generators are run very early at boot and cannot rely on any external - services. They may not talk to any other process. That includes simple things - such as logging to - syslog3, - or systemd itself (this means: no + Generators are run very early at boot and cannot rely on any external services. They may not + talk to any other process. That includes simple things such as logging to syslog3, or + systemd itself (this means: no systemctl1)! - Non-essential file systems like /var/ and - /home/ are mounted after generators have run. Generators - can however rely on the most basic kernel functionality to be available, - including a mounted /sys/, /proc/, - /dev/, /usr/. + Non-essential file systems like /var/ and /home/ are + mounted after generators have run. Generators can however rely on the most basic kernel functionality + to be available, as well as mounted /sys/, /proc/, + /dev/, /usr/ and /run/ file systems. @@ -176,12 +175,18 @@ - Generators should only be used to generate unit files and symlinks to - them, not any other kind of configuration. Due to the lifecycle logic - mentioned above, generators are not a good fit to generate dynamic - configuration for other services. If you need to generate dynamic - configuration for other services, do so in normal services you order before - the service in question. + Generators should only be used to generate unit files, .d/*.conf drop-ins + for them and symlinks to them, not any other kind of non-unit related configuration. Due to the + lifecycle logic mentioned above, generators are not a good fit to generate dynamic configuration for + other services. If you need to generate dynamic configuration for other services, do so in normal + services you order before the service in question. + + Note that using the StandardInputData=/StandardInputText= + settings of service unit files (see + systemd.exec5), it + is possible to make arbitrary input data (including daemon-specific configuration) part of the unit + definitions, which often might be sufficient to embed data or configuration for other programs into + unit files in a native fashion. -- cgit v1.2.3