chiark / gitweb /
status: show status messages unconditionally if plymouth is around
[elogind.git] / src / unit.c
index 10de40affc40fb3ba3fdd184d00c0a7b7a818845..b68464922401885afb73a4b9e47c1f5731b5d419 100644 (file)
@@ -1211,7 +1211,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
                         retroactively_stop_dependencies(u);
         }
 
-        if (ns != os && ns == UNIT_FAILED) {
+        if (ns != os && ns == UNIT_FAILED && u->meta.manager->n_deserializing <= 0) {
                 log_notice("Unit %s entered failed state.", u->meta.id);
                 unit_trigger_on_failure(u);
         }
@@ -1224,12 +1224,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
                          * yet connected. */
                         bus_init(u->meta.manager, true);
 
-                if (unit_has_name(u, SPECIAL_SYSLOG_SERVICE))
-                        /* The syslog daemon just might have become
-                         * available, hence try to connect to it, if
-                         * we aren't yet connected. */
-                        log_open();
-
                 if (u->meta.type == UNIT_SERVICE &&
                     !UNIT_IS_ACTIVE_OR_RELOADING(os)) {
                         /* Write audit record if we have just finished starting up */
@@ -1242,12 +1236,6 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
 
         } else {
 
-                if (unit_has_name(u, SPECIAL_SYSLOG_SERVICE))
-                        /* The syslog daemon might just have
-                         * terminated, hence try to disconnect from
-                         * it. */
-                        log_close_syslog();
-
                 /* We don't care about D-Bus here, since we'll get an
                  * asynchronous notification for it anyway. */
 
@@ -1277,6 +1265,8 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
 
         unit_add_to_dbus_queue(u);
         unit_add_to_gc_queue(u);
+
+        manager_recheck_syslog(u->meta.manager);
 }
 
 int unit_watch_fd(Unit *u, int fd, uint32_t events, Watch *w) {
@@ -2190,6 +2180,8 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
                                 log_debug("Failed to parse condition result value %s", v);
                         else
                                 u->meta.condition_result = b;
+
+                        continue;
                 }
 
                 if ((r = UNIT_VTABLE(u)->deserialize_item(u, l, v, fds)) < 0)
@@ -2241,7 +2233,7 @@ int unit_coldplug(Unit *u) {
                         return r;
 
         if (u->meta.deserialized_job >= 0) {
-                if ((r = manager_add_job(u->meta.manager, u->meta.deserialized_job, u, JOB_FAIL, false, NULL, NULL)) < 0)
+                if ((r = manager_add_job(u->meta.manager, u->meta.deserialized_job, u, JOB_IGNORE_DEPENDENCIES, false, NULL, NULL)) < 0)
                         return r;
 
                 u->meta.deserialized_job = _JOB_TYPE_INVALID;
@@ -2262,7 +2254,10 @@ void unit_status_printf(Unit *u, const char *format, ...) {
         if (u->meta.manager->running_as != MANAGER_SYSTEM)
                 return;
 
-        if (!u->meta.manager->show_status)
+        /* If Plymouth is running make sure we show the status, so
+         * that there's something nice to see when people press Esc */
+
+        if (!u->meta.manager->show_status && !plymouth_running())
                 return;
 
         if (!manager_is_booting_or_shutting_down(u->meta.manager))