1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

unit: when deserializing do reconnect to dbus/syslog when they show up

This commit is contained in:
Lennart Poettering 2011-03-30 20:16:07 +02:00
parent fac9f8df1f
commit 3b2775c5ce

View File

@ -1221,7 +1221,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
log_notice("Unit %s entered failed state.", u->meta.id); log_notice("Unit %s entered failed state.", u->meta.id);
unit_trigger_on_failure(u); unit_trigger_on_failure(u);
} }
}
/* Some names are special */ /* Some names are special */
if (UNIT_IS_ACTIVE_OR_RELOADING(ns)) { if (UNIT_IS_ACTIVE_OR_RELOADING(ns)) {
@ -1233,7 +1233,8 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
bus_init(u->meta.manager, true); bus_init(u->meta.manager, true);
if (u->meta.type == UNIT_SERVICE && if (u->meta.type == UNIT_SERVICE &&
!UNIT_IS_ACTIVE_OR_RELOADING(os)) { !UNIT_IS_ACTIVE_OR_RELOADING(os) &&
u->meta.manager->n_deserializing <= 0) {
/* Write audit record if we have just finished starting up */ /* Write audit record if we have just finished starting up */
manager_send_unit_audit(u->meta.manager, u, AUDIT_SERVICE_START, true); manager_send_unit_audit(u->meta.manager, u, AUDIT_SERVICE_START, true);
u->meta.in_audit = true; u->meta.in_audit = true;
@ -1249,7 +1250,8 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
if (u->meta.type == UNIT_SERVICE && if (u->meta.type == UNIT_SERVICE &&
UNIT_IS_INACTIVE_OR_FAILED(ns) && UNIT_IS_INACTIVE_OR_FAILED(ns) &&
!UNIT_IS_INACTIVE_OR_FAILED(os)) { !UNIT_IS_INACTIVE_OR_FAILED(os) &&
u->meta.manager->n_deserializing <= 0) {
/* Hmm, if there was no start record written /* Hmm, if there was no start record written
* write it now, so that we always have a nice * write it now, so that we always have a nice
@ -1268,7 +1270,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
} }
manager_recheck_syslog(u->meta.manager); manager_recheck_syslog(u->meta.manager);
}
/* Maybe we finished startup and are now ready for being /* Maybe we finished startup and are now ready for being
* stopped because unneeded? */ * stopped because unneeded? */