summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-04-06 12:15:33 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-04-28 18:57:37 +0200
commit10ee46a2ca6e58c40cd48ecee5f7d9b3a1c87ad3 (patch)
treebe4f79cc7e45a4239075eefeed02bf042771be9e
parentdf6253cbda3e5d1b3c694de223cb7899f3aecc74 (diff)
downloadsystemd-10ee46a2ca6e58c40cd48ecee5f7d9b3a1c87ad3.tar.gz
analyze: Fix verify exit status regression
Previously, systemd-analyze verify would return 0 even if warnings were raised during analysis of the specified units or their dependencies. With 3cc3dc7, verify was changed to return 1 when warnings were raised. This commit changes the default mode to _RECURSIVE_ERRORS_INVALID so that verify returns zero again by default when warnings are raised. (cherry picked from commit cae7c282721ce13fc1405fc834382d3177a9b83d)
-rw-r--r--man/systemd-analyze.xml10
-rw-r--r--src/analyze/analyze.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml
index 7baa1794d7..97290d479b 100644
--- a/man/systemd-analyze.xml
+++ b/man/systemd-analyze.xml
@@ -819,10 +819,12 @@ $ systemd-analyze verify /tmp/source:alias.service
<listitem><para>Control verification of units and their dependencies and whether
<command>systemd-analyze verify</command> exits with a non-zero process exit status or not. With
<command>yes</command>, return a non-zero process exit status when warnings arise during verification
- of either the specified unit or any of its associated dependencies. This is the default. With
- <command>no</command>, return a non-zero process exit status when warnings arise during verification
- of only the specified unit. With <command>one</command>, return a non-zero process exit status when
- warnings arise during verification of either the specified unit or its immediate dependencies. </para></listitem>
+ of either the specified unit or any of its associated dependencies. With <command>no</command>,
+ return a non-zero process exit status when warnings arise during verification of only the specified
+ unit. With <command>one</command>, return a non-zero process exit status when warnings arise during
+ verification of either the specified unit or its immediate dependencies. If this option is not
+ specified, zero is returned as the exit status regardless whether warnings arise during verification
+ or not.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index a1908ff442..ba6d8f74fe 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -93,7 +93,7 @@ static PagerFlags arg_pager_flags = 0;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
static const char *arg_host = NULL;
static UnitFileScope arg_scope = UNIT_FILE_SYSTEM;
-static RecursiveErrors arg_recursive_errors = RECURSIVE_ERRORS_YES;
+static RecursiveErrors arg_recursive_errors = _RECURSIVE_ERRORS_INVALID;
static bool arg_man = true;
static bool arg_generators = false;
static char *arg_root = NULL;