summaryrefslogtreecommitdiffstats
path: root/man/systemd-analyze.xml
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-06-26 14:58:45 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-06-27 10:54:37 +0200
commitedfea9fe0db025d8b90f07d969b48a1017399265 (patch)
tree4cf0ac0cc9085fbe600cf0a15f733f809b8fdb4f /man/systemd-analyze.xml
parentcore: do not enumerate units in MANAGER_TEST_RUN_MINIMAL mode (diff)
downloadsystemd-edfea9fe0db025d8b90f07d969b48a1017399265.tar.xz
systemd-edfea9fe0db025d8b90f07d969b48a1017399265.zip
analyze: add 'condition' verb
We didn't have a straightforward way to parse and evaluate those strings. Prompted by #12881.
Diffstat (limited to 'man/systemd-analyze.xml')
-rw-r--r--man/systemd-analyze.xml33
1 files changed, 33 insertions, 0 deletions
diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml
index 651a73848e..5dce2ae8fb 100644
--- a/man/systemd-analyze.xml
+++ b/man/systemd-analyze.xml
@@ -86,6 +86,12 @@
<cmdsynopsis>
<command>systemd-analyze</command>
<arg choice="opt" rep="repeat">OPTIONS</arg>
+ <arg choice="plain">condition</arg>
+ <arg choice="plain"><replaceable>CONDITION</replaceable>…</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>systemd-analyze</command>
+ <arg choice="opt" rep="repeat">OPTIONS</arg>
<arg choice="plain">syscall-filter</arg>
<arg choice="opt"><replaceable>SET</replaceable>…</arg>
</cmdsynopsis>
@@ -349,6 +355,33 @@ $ eog targets.svg</programlisting>
</refsect2>
<refsect2>
+ <title><command>systemd-analyze condition <replaceable>CONDITION</replaceable>...</command></title>
+
+ <para>This command will evaluate <varname noindex='true'>Condition*=...</varname> and
+ <varname noindex='true'>Assert*=...</varname> assignments, and print their values, and
+ the resulting value of the combined condition set. See
+ <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ for a list of available conditions and asserts.</para>
+
+ <example>
+ <title>Evaluate conditions that check kernel versions</title>
+
+ <programlisting>$ systemd-analyze condition 'ConditionKernelVersion = ! &lt;4.0' \
+ 'ConditionKernelVersion = &gt;=5.1' \
+ 'ConditionACPower=|false' \
+ 'ConditionArchitecture=|!arm' \
+ 'AssertPathExists=/etc/os-release'
+test.service: AssertPathExists=/etc/os-release succeeded.
+Asserts succeeded.
+test.service: ConditionArchitecture=|!arm succeeded.
+test.service: ConditionACPower=|false failed.
+test.service: ConditionKernelVersion=&gt;=5.1 succeeded.
+test.service: ConditionKernelVersion=!&lt;4.0 succeeded.
+Conditions succeeded.</programlisting>
+ </example>
+ </refsect2>
+
+ <refsect2>
<title><command>systemd-analyze syscall-filter <optional><replaceable>SET</replaceable>...</optional></command></title>
<para>This command will list system calls contained in the specified system call set