]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
doc: document the two new env vars set by the service manager
authorLennart Poettering <lennart@poettering.net>
Wed, 4 Jul 2018 13:36:06 +0000 (15:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 20 Jul 2018 14:57:35 +0000 (16:57 +0200)
doc/ENVIRONMENT.md

index 641a03d5d722240c13872d0cae1b83d7b88dfa06..c69bf9b66467c234948f504792025ac34ec3c1b1 100644 (file)
@@ -101,3 +101,21 @@ systemd-timedated:
   NTP client services. If set, `timedatectl set-ntp on` enables and starts the
   first existing unit listed in the environment variable, and
   `timedatectl set-ntp off` disables and stops all listed units.
+
+systemd itself:
+
+* `$SYSTEMD_ACTIVATION_UNIT` — set for all NSS and PAM module invocations that
+  are done by the service manager on behalf of a specific unit, in child
+  processes that are later (after execve()) going to become unit
+  processes. Contains the full unit name (e.g. "foobar.service"). NSS and PAM
+  modules can use this information to determine in which context and on whose
+  behalf they are being called, which may be useful to avoid deadlocks, for
+  example to bypass IPC calls to the very service that is about to be
+  started. Note that NSS and PAM modules should be careful to only rely on this
+  data when invoked privileged, or possibly only when getppid() returns 1, as
+  setting environment variables is of course possible in any even unprivileged
+  contexts.
+
+* `$SYSTEMD_ACTIVATION_SCOPE` — closely related to `$SYSTEMD_ACTIVATION_UNIT`,
+  it is either set to `system` or `user` depending on whether the NSS/PAM
+  module is called by systemd in `--system` or `--user` mode.