X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Funit.c;h=2f0ac00fcf1fe9ab26b1529d43da0085368fd38c;hp=601be60ed0595311910218a2b916f0ae2112bbf5;hb=9e9e2b722cf796b58e959cd174d87ce0ec0bc996;hpb=945d1442ed5d6cf50b0d0a45fe482130f74f2997 diff --git a/src/core/unit.c b/src/core/unit.c index 601be60ed..2f0ac00fc 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1360,11 +1360,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su if (UNIT_IS_INACTIVE_OR_FAILED(os) != UNIT_IS_INACTIVE_OR_FAILED(ns)) { ExecContext *ec = unit_get_exec_context(u); if (ec && exec_context_may_touch_console(ec)) { - /* XXX The counter may get out of sync if the admin edits - * TTY-related unit file properties and issues a daemon-reload - * while the unit is active. No big deal though, because - * it influences only the printing of boot/shutdown - * status messages. */ if (UNIT_IS_INACTIVE_OR_FAILED(ns)) m->n_on_console--; else @@ -2446,6 +2441,9 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { return r; } + if (j->state == JOB_RUNNING) + u->manager->n_running_jobs++; + r = job_install_deserialized(j); if (r < 0) { hashmap_remove(u->manager->jobs, UINT32_TO_PTR(j->id));