From 185af6ebd3bcf572dd1645ca8d3909ca715a32e7 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 26 Oct 2025 21:23:55 +0100 Subject: [PATCH 1/3] core/manager: kill unused default_unit_job_id field While at it, make sure the "Queued ... job for default target" message is always logged, i.e. also when we fall back to start job instead of isolate. --- src/core/main.c | 8 +++----- src/core/manager.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index 183aac5379..d7651d0df9 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2639,12 +2639,10 @@ static int do_queue_default_job( return log_struct_errno(LOG_EMERG, r, LOG_MESSAGE("Failed to isolate default target: %s", bus_error_message(&error, r)), LOG_MESSAGE_ID(SD_MESSAGE_CORE_ISOLATE_TARGET_FAILED_STR)); - } else - log_info("Queued %s job for default target %s.", - job_type_to_string(job->type), - unit_status_string(job->unit, NULL)); + } - m->default_unit_job_id = job->id; + log_info("Queued %s job for default target %s.", + job_type_to_string(job->type), unit_status_string(job->unit, NULL)); return 0; } diff --git a/src/core/manager.h b/src/core/manager.h index 00f3becd63..74bdb7f491 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -324,7 +324,6 @@ typedef struct Manager { bool send_reloading_done; uint32_t current_job_id; - uint32_t default_unit_job_id; /* Data specific to the Automount subsystem */ int dev_autofs_fd; From 4fc9e19f7fb4f6b900ecb8c15679b9596a0820e1 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 26 Oct 2025 21:23:34 +0100 Subject: [PATCH 2/3] core/manager: drop unneeded "struct" --- src/core/manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/manager.h b/src/core/manager.h index 74bdb7f491..3197ca9f18 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -173,7 +173,7 @@ typedef struct Manager { LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */ /* Jobs that need to be run */ - struct Prioq *run_queue; + Prioq *run_queue; /* Units and jobs that have not yet been announced via * D-Bus. When something about a job changes it is added here From f873ac8727b666482f53aef70d47e7249d864cc0 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sun, 26 Oct 2025 21:26:58 +0100 Subject: [PATCH 3/3] core/manager: rearrange several struct fields --- src/core/manager.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/manager.h b/src/core/manager.h index 3197ca9f18..b7ee766b05 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -321,8 +321,6 @@ typedef struct Manager { Hashmap *watch_bus; /* D-Bus names => Unit object n:1 */ - bool send_reloading_done; - uint32_t current_job_id; /* Data specific to the Automount subsystem */ @@ -330,8 +328,8 @@ typedef struct Manager { /* Data specific to the cgroup subsystem */ Hashmap *cgroup_unit; - CGroupMask cgroup_supported; char *cgroup_root; + CGroupMask cgroup_supported; /* Notifications from cgroups, when the unified hierarchy is used is done via inotify. */ int cgroup_inotify_fd; @@ -364,6 +362,8 @@ typedef struct Manager { bool dispatching_load_queue; int may_dispatch_stop_notify_queue; /* tristate */ + bool send_reloading_done; + /* Have we already sent out the READY=1 notification? */ bool ready_sent;