From: Mike Yuan Date: Fri, 28 Jun 2024 13:32:33 +0000 (+0200) Subject: core/unit: follow merged units before updating SourcePath= timestamp too X-Git-Tag: v257-rc1~1020 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=740cd1e0f2ae5cc1a10d2111d63cc4e975761091;p=thirdparty%2Fsystemd.git 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. --- 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;