Merge pull request #24071 from bluca/path_trigger_report

path/timer units: export env vars and D-Bus properties with reason that triggered the job
This commit is contained in:
Lennart Poettering
2022-08-24 09:35:59 +02:00
committed by GitHub
34 changed files with 728 additions and 59 deletions
+22
View File
@@ -1898,6 +1898,7 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
readonly s CollectMode = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("false")
readonly as Refs = ['...', ...];
readonly a(ss) ActivationDetails = [...];
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
@@ -2229,6 +2230,8 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
<variablelist class="dbus-property" generated="True" extra-ref="Refs"/>
<variablelist class="dbus-property" generated="True" extra-ref="ActivationDetails"/>
<!--End of Autogenerated section-->
<refsect2>
@@ -2406,6 +2409,18 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
<para><varname>Transient</varname> contains a boolean that indicates whether the unit was created as a
transient unit (i.e. via <function>CreateTransientUnit()</function> on the manager object).</para>
<para><varname>ActivationDetails</varname> contains a list of string pairs, key and value, that
describe the event that caused the unit to be activated, if any. The key describes the information
(e.g.: <varname>trigger_unit</varname>, with value <varname>foo.service</varname>). This is only filled
in if the unit was triggered by a <varname>Path</varname> or <varname>Timer</varname> unit, and it is
only provided in a best effort fashion: it is not guaranteed to be set, and it is not guaranteed to be
the only trigger. It is only guaranteed to be a valid trigger that caused the activation job to be
enqueued and complete successfully. The key value pairs correspond (in lowercase) to the environment
variables described in the <literal>Environment Variables Set on Triggered Units</literal> section in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
Note that new key value pair may be added at any time in future versions. Existing entries will not be
removed.</para>
</refsect2>
<refsect2>
@@ -10650,6 +10665,8 @@ node /org/freedesktop/systemd1/job/666 {
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly s JobType = '...';
readonly s State = '...';
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
readonly a(ss) ActivationDetails = [...];
};
interface org.freedesktop.DBus.Peer { ... };
interface org.freedesktop.DBus.Introspectable { ... };
@@ -10681,6 +10698,8 @@ node /org/freedesktop/systemd1/job/666 {
<variablelist class="dbus-property" generated="True" extra-ref="State"/>
<variablelist class="dbus-property" generated="True" extra-ref="ActivationDetails"/>
<!--End of Autogenerated section-->
<refsect2>
@@ -10709,6 +10728,9 @@ node /org/freedesktop/systemd1/job/666 {
<para><varname>State</varname> refers to the job's state and is one of <literal>waiting</literal> and
<literal>running</literal>. The former indicates that a job is currently queued but has not begun to
execute yet. The latter indicates that a job is currently being executed.</para>
<para><varname>ActivationDetails</varname> has the same content as the property of the same name under
the <varname>org.freedesktop.systemd1.Unit</varname> interface.</para>
</refsect2>
</refsect1>
+15
View File
@@ -3695,6 +3695,21 @@ StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZX
system.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>$TRIGGER_UNIT</varname></term>
<term><varname>$TRIGGER_PATH</varname></term>
<term><varname>$TRIGGER_TIMER_REALTIME_USEC</varname></term>
<term><varname>$TRIGGER_TIMER_MONOTONIC_USEC</varname></term>
<listitem><para>If the unit was activated dynamically (e.g.: a corresponding path unit or timer unit), the
unit that triggered it and other type-dependent information will be passed via these variables. Note that
this information is provided in a best-effort way. For example, multiple triggers happening one after
another will be coalesced and only one will be reported, with no guarantee as to which one it will be.
Because of this, in most cases this variable will be primarily informational, i.e. useful for debugging
purposes, is lossy, and should not be relied upon to propagate a comprehensive reason for activation.
</para></listitem>
</varlistentry>
</variablelist>
<para>For system services, when <varname>PAMName=</varname> is enabled and <command>pam_systemd</command> is part
+4
View File
@@ -208,6 +208,10 @@
<refsect1>
<title>See Also</title>
<para>Environment variables with details on the trigger will be set for triggered units. See the
<literal>Environment Variables Set on Triggered Units</literal> section in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for more details.</para>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+4
View File
@@ -366,6 +366,10 @@
<refsect1>
<title>See Also</title>
<para>Environment variables with details on the trigger will be set for triggered units. See the
<literal>Environment Variables Set on Triggered Units</literal> section in
<citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for more details.</para>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,