diff options
author | Ivan Shapovalov <intelfx100@gmail.com> | 2015-04-27 21:19:02 +0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-04-27 21:45:12 +0200 |
commit | 4370633083dd9453da183c468cf89cc17254ac39 (patch) | |
tree | 815b2c330f6c493a4c38ae449ba6042189f059a8 /src/core/transaction.c | |
parent | 329c542585cd92cb905990e3bf59eda16fd88cfb (diff) |
core: coldplug all units which participate in jobs during coldplugging
This is yet another attempt to fix coldplugging order (more especially,
the problem which happens when one creates a job during coldplugging and
it references a not-yet-coldplugged unit).
Now we forcibly coldplug all units which participate in jobs. This
is a superset of previously implemented handling of the UNIT_TRIGGERS
dependencies, so that handling is removed.
http://lists.freedesktop.org/archives/systemd-devel/2015-April/031212.html
https://bugs.freedesktop.org/show_bug.cgi?id=88401 (once again)
Diffstat (limited to 'src/core/transaction.c')
-rw-r--r-- | src/core/transaction.c | 7 |
1 files changed, 7 insertions, 0 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", */ |