]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: Use "unmet" for condition checks, not "failed"
authorColin Walters <walters@verbum.org>
Wed, 31 Aug 2022 20:39:03 +0000 (16:39 -0400)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 1 Sep 2022 06:03:40 +0000 (15:03 +0900)
Often I end up debugging a problem on a system, and I
do e.g. `journalctl --grep=failed|error`.  The use of the term
"failed" for condition checks adds a *lot* of unnecessary noise into
this.

Now, I know this regexp search isn't precise, but it has proven
to be useful to me.

I think "failed" is too strong of a term as a baseline, and also
just stands out to e.g. humans watching their servers boot or
whatever.

The term "met condition" is fairly widely used, e.g.
https://stackoverflow.com/questions/63751794/what-does-the-condition-is-met-exactly-mean-in-programming-languages

Use that instead.

man/systemd.unit.xml
src/core/job.c
src/core/job.h
src/core/path.c
src/core/unit.c

index a9114fb353f1dc717fa744c3fca61e7b6f06fdb9..7c1f7186e2fb772fd00925a2bc6644e4162ba838 100644 (file)
         <para>When used in conjunction with <varname>After=</varname> on the same unit the behaviour of
         <varname>BindsTo=</varname> is even stronger. In this case, the unit bound to strictly has to be in active
         state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly
-        enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition
+        enters inactive state, but also one that is bound to another unit that gets skipped due to an unmet condition
         check (such as <varname>ConditionPathExists=</varname>, <varname>ConditionPathIsSymbolicLink=</varname>, … —
         see below) will be stopped, should it be running. Hence, in many cases it is best to combine
         <varname>BindsTo=</varname> with <varname>After=</varname>.</para>
 
       <para>The <varname>AssertArchitecture=</varname>, <varname>AssertVirtualization=</varname>, … options
       are similar to conditions but cause the start job to fail (instead of being skipped). The failed check
-      is logged. Units with failed conditions are considered to be in a clean state and will be garbage
+      is logged. Units with unmet conditions are considered to be in a clean state and will be garbage
       collected if they are not referenced. This means that when queried, the condition failure may or may
       not show up in the state of the unit.</para>
 
index dd8d858bd2d945e9eb99ab1b98a5d55cfac1481f..7905561cca40bbfb10b40b04808fbf2f0e3a0795 100644 (file)
@@ -610,7 +610,7 @@ static const char* job_done_message_format(Unit *u, JobType t, JobResult result)
         assert(t >= 0);
         assert(t < _JOB_TYPE_MAX);
 
-        /* Show condition check message if the job did not actually do anything due to failed condition. */
+        /* Show condition check message if the job did not actually do anything due to unmet condition. */
         if (t == JOB_START && result == JOB_DONE && !u->condition_result)
                 return "Condition check resulted in %s being skipped.";
 
@@ -702,7 +702,7 @@ static void job_emit_done_message(Unit *u, uint32_t job_id, JobType t, JobResult
         bool console_only = do_console && log_on_console();
 
         if (t == JOB_START && result == JOB_DONE && !u->condition_result) {
-                /* No message on the console if the job did not actually do anything due to failed condition. */
+                /* No message on the console if the job did not actually do anything due to unmet condition. */
                 if (console_only)
                         return;
                 else
@@ -716,13 +716,13 @@ static void job_emit_done_message(Unit *u, uint32_t job_id, JobType t, JobResult
 
                 c = t == JOB_START && result == JOB_DONE ? unit_find_failed_condition(u) : NULL;
                 if (c) {
-                        /* Special case units that were skipped because of a failed condition check so that
+                        /* Special case units that were skipped because of a unmet condition check so that
                          * we can add more information to the message. */
                         if (c->trigger)
                                 log_unit_struct(
                                         u,
                                         job_done_messages[result].log_level,
-                                        LOG_MESSAGE("%s was skipped because all trigger condition checks failed.",
+                                        LOG_MESSAGE("%s was skipped because no trigger condition checks were met.",
                                                     ident),
                                         "JOB_ID=%" PRIu32, job_id,
                                         "JOB_TYPE=%s", job_type_to_string(t),
@@ -733,7 +733,7 @@ static void job_emit_done_message(Unit *u, uint32_t job_id, JobType t, JobResult
                                 log_unit_struct(
                                         u,
                                         job_done_messages[result].log_level,
-                                        LOG_MESSAGE("%s was skipped because of a failed condition check (%s=%s%s).",
+                                        LOG_MESSAGE("%s was skipped because of an unmet condition check (%s=%s%s).",
                                                     ident,
                                                     condition_type_to_string(c->type),
                                                     c->negate ? "!" : "",
index 0305e0ea4451244f4b8d64f626037cacf73d90b0..30a7903aa39d07724196a84e8064d5f7a0ad9e0f 100644 (file)
@@ -84,7 +84,7 @@ enum JobMode {
 };
 
 enum JobResult {
-        JOB_DONE,                /* Job completed successfully (or skipped due to a failed ConditionXYZ=) */
+        JOB_DONE,                /* Job completed successfully (or skipped due to an unmet ConditionXYZ=) */
         JOB_CANCELED,            /* Job canceled by a conflicting job installation or by explicit cancel request */
         JOB_TIMEOUT,             /* Job timeout elapsed */
         JOB_FAILED,              /* Job failed */
index 2810e30573d826d9c8b96e606f596a4407e8b908..3a46e44928813912e3b6f19af1c35670c97e51b8 100644 (file)
@@ -369,7 +369,7 @@ static int path_add_extras(Path *p) {
 
         assert(p);
 
-        /* To avoid getting pid1 in a busy-loop state (eg: failed condition on associated service),
+        /* To avoid getting pid1 in a busy-loop state (eg: unmet condition on associated service),
          * set a default trigger limit if the user didn't specify any. */
         if (p->trigger_limit.interval == USEC_INFINITY)
                 p->trigger_limit.interval = 2 * USEC_PER_SEC;
index 82a1d81e04d63bb63186523e014e76a0e34fea42..81e37641415b0ef40819894bee06e0bc4ca994bc 100644 (file)
@@ -1916,7 +1916,7 @@ int unit_start(Unit *u, ActivationDetails *details) {
 
         /* Let's make sure that the deps really are in order before we start this. Normally the job engine
          * should have taken care of this already, but let's check this here again. After all, our
-         * dependencies might not be in effect anymore, due to a reload or due to a failed condition. */
+         * dependencies might not be in effect anymore, due to a reload or due to an unmet condition. */
         if (!unit_verify_deps(u))
                 return -ENOLINK;