summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/transaction.c7
-rw-r--r--src/core/unit.c8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 5974b1e96b..7b19e2f841 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -848,6 +848,13 @@ int transaction_add_job_and_dependencies(
assert(type < _JOB_TYPE_MAX_IN_TRANSACTION);
assert(unit);
+ /* Before adding jobs for this unit, let's ensure that its state has been loaded
+ * This matters when jobs are spawned as part of coldplugging itself (see e. g. path_coldplug()).
+ * This way, we "recursively" coldplug units, ensuring that we do not look at state of
+ * not-yet-coldplugged units. */
+ if (unit->manager->n_reloading > 0)
+ unit_coldplug(unit);
+
/* log_debug("Pulling in %s/%s from %s/%s", */
/* unit->id, job_type_to_string(type), */
/* by ? by->unit->id : "NA", */
diff --git a/src/core/unit.c b/src/core/unit.c
index 496db6c4cd..b7ab084de9 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2893,14 +2893,6 @@ int unit_coldplug(Unit *u) {
u->coldplugged = true;
- /* Make sure everything that we might pull in through
- * triggering is coldplugged before us */
- SET_FOREACH(other, u->dependencies[UNIT_TRIGGERS], i) {
- r = unit_coldplug(other);
- if (r < 0)
- return r;
- }
-
if (UNIT_VTABLE(u)->coldplug) {
r = UNIT_VTABLE(u)->coldplug(u);
if (r < 0)