]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: Fix verify exit status regression
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 6 Apr 2022 10:15:33 +0000 (12:15 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 6 Apr 2022 14:16:02 +0000 (23:16 +0900)
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.

man/systemd-analyze.xml
src/analyze/analyze.c

index 7baa1794d7c255543302ba28306dbe618d1f7741..97290d479b4403dab90b5df829ed2110882c010b 100644 (file)
@@ -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>
index 905ff2c27f44d0d7cb163ebcd7ff4759fa7fa047..cb83e738770f4ed89ac9589029afa0035ec451a0 100644 (file)
@@ -90,7 +90,7 @@ PagerFlags arg_pager_flags = 0;
 BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
 const char *arg_host = NULL;
 LookupScope arg_scope = LOOKUP_SCOPE_SYSTEM;
-RecursiveErrors arg_recursive_errors = RECURSIVE_ERRORS_YES;
+RecursiveErrors arg_recursive_errors = _RECURSIVE_ERRORS_INVALID;
 bool arg_man = true;
 bool arg_generators = false;
 char *arg_root = NULL;