summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-06-28 15:32:33 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-06-28 21:10:16 +0200
commit740cd1e0f2ae5cc1a10d2111d63cc4e975761091 (patch)
tree19ac1df6c53d086b39ece58e8fec447a3f34217f /src/core
parentMerge pull request #33517 from keszybz/a-few-unrelated-cleanups (diff)
downloadsystemd-740cd1e0f2ae5cc1a10d2111d63cc4e975761091.tar.xz
systemd-740cd1e0f2ae5cc1a10d2111d63cc4e975761091.zip
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.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/unit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 0e931be484..32f28b286b 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;