From: Lennart Poettering Date: Tue, 12 Apr 2022 21:29:36 +0000 (+0200) Subject: man: document new generator env vars X-Git-Tag: v251-rc2~132^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b9d199ab4663dfd56afc8f6045eb71047e3bc03;p=thirdparty%2Fsystemd.git man: document new generator env vars --- diff --git a/man/systemd.generator.xml b/man/systemd.generator.xml index 287d4a8f4b6..1f916ac65eb 100644 --- a/man/systemd.generator.xml +++ b/man/systemd.generator.xml @@ -128,6 +128,66 @@ + + Environment + + The service manager sets a number of environment variables when invoking generator + executables. They carry information about the execution context of the generator, in order to simplify + conditionalizing generators to specific environments. The following environment variables are set: + + + + $SYSTEMD_SCOPE + + If the generator is invoked from the system service manager this variable is set to + system; if invoked from the per-user service manager it is set to + user. + + + + $SYSTEMD_IN_INITRD + + If the generator is run as part of an initial RAM file system (initrd) this is set to + 1. If it is run from the regular host (i.e. after the transition from initrd to + host) it is set to 0. This environment variable is only set for system + generators. + + + + $SYSTEMD_FIRST_BOOT + + If this boot-up cycle is considered a "first boot", this is set to + 1; if it is a subsequent, regular boot it is set to 0. For + details see the documentation of ConditionFirstBoot= in + systemd.unit5. This + environment variable is only set for system generators. + + + + $SYSTEMD_VIRTUALIZATION + + If the service manager is run in a virtualized environment, + $SYSTEMD_VIRTUALIZATION is set to a pair of strings, separated by a colon. The + first string is either vm or container, categorizing the type + of virtualization. The second string identifies the implementation of the virtualization + technology. If no virtualization is detected this variable will not be set. This data is identical to + what + systemd-detect-virt1 + detects and reports, and uses the same vocabulary of virtualization implementation + identifiers. + + + + $SYSTEMD_ARCHITECTURE + + This variable is set to a short identifier of the reported architecture of the + system. For details about defined values, see documentation of + ConditionArchitecture= in + systemd.unit5. + + + + Notes about writing generators