]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make log cycle messages recognizable via message IDs
authorLennart Poettering <lennart@poettering.net>
Wed, 18 Jun 2025 09:47:25 +0000 (11:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 23 Jun 2025 14:47:06 +0000 (16:47 +0200)
src/core/transaction.c
src/systemd/sd-messages.h

index 617ab1adc174ca204f8e187fb5574e377b343c87..8962bf94616685821b298620b8b76ad3c7afdd81 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "sd-bus.h"
+#include "sd-messages.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
@@ -412,6 +413,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
                 if (cycle_path_text)
                         log_struct(LOG_WARNING,
                                    LOG_UNIT_MESSAGE(j->unit, "%s", cycle_path_text),
+                                   LOG_MESSAGE_ID(SD_MESSAGE_UNIT_ORDERING_CYCLE_STR),
                                    LOG_ITEM("%s", strna(unit_ids)));
 
                 if (delete) {
@@ -422,6 +424,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
                                                     "Job %s/%s deleted to break ordering cycle starting with %s/%s",
                                                     delete->unit->id, job_type_to_string(delete->type),
                                                     j->unit->id, job_type_to_string(j->type)),
+                                   LOG_MESSAGE_ID(SD_MESSAGE_DELETING_JOB_BECAUSE_ORDERING_CYCLE_STR),
                                    LOG_ITEM("%s", strna(unit_ids)));
 
                         if (log_get_show_color())
@@ -441,6 +444,7 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
                 log_struct(LOG_ERR,
                            LOG_UNIT_MESSAGE(j->unit, "Unable to break cycle starting with %s/%s",
                                             j->unit->id, job_type_to_string(j->type)),
+                           LOG_MESSAGE_ID(SD_MESSAGE_CANT_BREAK_ORDERING_CYCLE_STR),
                            LOG_ITEM("%s", strna(unit_ids)));
 
                 return sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC,
index 319154824a52c2dac20991ceff2b627b7191babe..02edf9facf71b004ca38af8ca3e8819fa851fb8a 100644 (file)
@@ -292,6 +292,15 @@ _SD_BEGIN_DECLARATIONS;
 #define SD_MESSAGE_SYSCTL_CHANGED                     SD_ID128_MAKE(9c,f5,6b,8b,af,95,46,cf,94,78,78,3a,8d,e4,21,13)
 #define SD_MESSAGE_SYSCTL_CHANGED_STR                 SD_ID128_MAKE_STR(9c,f5,6b,8b,af,95,46,cf,94,78,78,3a,8d,e4,21,13)
 
+#define SD_MESSAGE_UNIT_ORDERING_CYCLE                SD_ID128_MAKE(f2,7a,3f,94,40,6a,47,83,b9,46,a9,bc,84,9e,94,52)
+#define SD_MESSAGE_UNIT_ORDERING_CYCLE_STR            SD_ID128_MAKE_STR(f2,7a,3f,94,40,6a,47,83,b9,46,a9,bc,84,9e,94,52)
+
+#define SD_MESSAGE_DELETING_JOB_BECAUSE_ORDERING_CYCLE     SD_ID128_MAKE(50,84,36,75,42,f7,47,2d,bc,6a,94,12,5d,5d,eb,ce)
+#define SD_MESSAGE_DELETING_JOB_BECAUSE_ORDERING_CYCLE_STR SD_ID128_MAKE_STR(50,84,36,75,42,f7,47,2d,bc,6a,94,12,5d,5d,eb,ce)
+
+#define SD_MESSAGE_CANT_BREAK_ORDERING_CYCLE          SD_ID128_MAKE(b3,11,2d,da,d1,90,45,53,8c,76,68,5b,a5,91,8a,80)
+#define SD_MESSAGE_CANT_BREAK_ORDERING_CYCLE_STR      SD_ID128_MAKE_STR(b3,11,2d,da,d1,90,45,53,8c,76,68,5b,a5,91,8a,80)
+
 _SD_END_DECLARATIONS;
 
 #endif