summaryrefslogtreecommitdiff
path: root/man/systemd.exec.xml
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-01-26 15:56:42 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-01 01:13:44 +0900
commitdc4e2940e87f4f0969476b45a1d25322b5210643 (patch)
tree67e353ff59e4139f794c7a9d2607e972c2b1ad90 /man/systemd.exec.xml
parentd2acb93dc52b23a9e5d36dda48c1988aa6e9adf1 (diff)
downloadsystemd-dc4e2940e87f4f0969476b45a1d25322b5210643.tar.gz
core: set $SYSTEMD_EXEC_PID= environment variable for executed commands
It may be useful to detect a command is directly executed by systemd manager, or indirectly as a child of another process.
Diffstat (limited to 'man/systemd.exec.xml')
-rw-r--r--man/systemd.exec.xml11
1 files changed, 11 insertions, 0 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index 203fc0355d..5b5590a233 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -3044,6 +3044,17 @@ StandardInputData=SWNrIHNpdHplIGRhIHVuJyBlc3NlIEtsb3BzLAp1ZmYgZWVtYWwga2xvcHAncy
</varlistentry>
<varlistentry>
+ <term><varname>$SYSTEMD_EXEC_PID</varname></term>
+
+ <listitem><para>The PID of the unit process (e.g. process invoked by
+ <varname>ExecStart=</varname>). The child process can use this information to determine
+ whether the process is directly invoked by the service manager or indirectly as a child of
+ another process by comparing this value with the current PID (as similar to the scheme used in
+ <citerefentry><refentrytitle>sd_listen_fds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ with <varname>$LISTEN_PID</varname> and <varname>$LISTEN_FDS</varname>).</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>$TERM</varname></term>
<listitem><para>Terminal type, set only for units connected to