X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Funit.c;h=0c92756cb7f7deb93aa2ace3f1a3bd60c10d53cc;hp=3f42f0fa1172ef5c23c86dbf9f9c7728fc780447;hb=9f611ad82e1eb1a9885f07ac95c244b25a7fbac7;hpb=4c633005eacdf964d22107f453ba804868f33a25 diff --git a/src/unit.c b/src/unit.c index 3f42f0fa1..0c92756cb 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))