systemctl: is-failed: check if system is degraded when no unit given

Closes #3335
This commit is contained in:
Mike Yuan
2023-10-19 00:12:28 +08:00
parent def1e20a18
commit 2ee346160c
4 changed files with 35 additions and 10 deletions
+6 -7
View File
@@ -219,15 +219,14 @@ Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago
</varlistentry>
<varlistentry>
<term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term>
<term><command>is-failed <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
<listitem>
<para>Check whether any of the specified units are in a
"failed" state. Returns an exit code
<constant>0</constant> if at least one has failed,
non-zero otherwise. Unless <option>--quiet</option> is
specified, this will also print the current unit state to
standard output.</para>
<para>Check whether any of the specified units is in the "failed" state. If no unit is specified,
check whether there are any failed units, which corresponds to the <literal>degraded</literal> state
returned by <command>is-system-running</command>. Returns an exit code <constant>0</constant>
if at least one has failed, non-zero otherwise. Unless <option>--quiet</option> is specified, this
will also print the current unit or system state to standard output.</para>
<xi:include href="version-info.xml" xpointer="v197"/>
</listitem>