diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-07-13 19:01:20 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-07-13 19:01:20 +0200 |
commit | 9f611ad82e1eb1a9885f07ac95c244b25a7fbac7 (patch) | |
tree | e0826c50fcb39a85fecb575d13bc5f64a9f6caf8 /src/unit.c | |
parent | 4c633005eacdf964d22107f453ba804868f33a25 (diff) |
unit: disable retroactive starting/stopping of units when deserializing
Diffstat (limited to 'src/unit.c')
-rw-r--r-- | src/unit.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/unit.c b/src/unit.c index 3f42f0fa11..0c92756cb7 100644 --- a/src/unit.c +++ b/src/unit.c @@ -1043,14 +1043,16 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns) { assert_not_reached("Job type unknown"); } - /* If this state change happened without being - * requested by a job, then let's retroactively start - * or stop dependencies */ - } else unexpected = true; - if (unexpected) { + /* If this state change happened without being requested by a + * job, then let's retroactively start or stop + * dependencies. We skip that step when deserializing, since + * we don't want to create any additional jobs just because + * something is already activated. */ + + if (unexpected && u->meta.manager->n_deserializing <= 0) { if (UNIT_IS_INACTIVE_OR_DEACTIVATING(os) && UNIT_IS_ACTIVE_OR_ACTIVATING(ns)) retroactively_start_dependencies(u); else if (UNIT_IS_ACTIVE_OR_ACTIVATING(os) && UNIT_IS_INACTIVE_OR_DEACTIVATING(ns)) |