From 740cd1e0f2ae5cc1a10d2111d63cc4e975761091 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Fri, 28 Jun 2024 15:32:33 +0200 Subject: [PATCH] core/unit: follow merged units before updating SourcePath= timestamp too Currently, we only follow merged units for unit_load_dropin() call. But if the unit is an alias, we should always perform operations on the "canonical" unit. --- src/core/unit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/unit.c b/src/core/unit.c index 0e931be4846..32f28b286ba 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1402,11 +1402,13 @@ int unit_load_fragment_and_dropin(Unit *u, bool fragment_required) { u->load_state = UNIT_LOADED; } + u = unit_follow_merge(u); + /* Load drop-in directory data. If u is an alias, we might be reloading the * target unit needlessly. But we cannot be sure which drops-ins have already * been loaded and which not, at least without doing complicated book-keeping, * so let's always reread all drop-ins. */ - r = unit_load_dropin(unit_follow_merge(u)); + r = unit_load_dropin(u); if (r < 0) return r; -- 2.47.3