chiark / gitweb /
core: print 'startup finished' messages even if we log to console
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Aug 2014 14:41:00 +0000 (16:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Aug 2014 16:10:31 +0000 (18:10 +0200)
src/core/manager.c

index 1bb0c9025f8c9833baf2c3f1b1fa9947ec6e92c3..7508fefaef2aa709691f76c3caf1b9a3fc8d0e2f 100644 (file)
@@ -2539,44 +2539,41 @@ void manager_check_finished(Manager *m) {
                         kernel_usec = m->initrd_timestamp.monotonic - m->kernel_timestamp.monotonic;
                         initrd_usec = m->userspace_timestamp.monotonic - m->initrd_timestamp.monotonic;
 
                         kernel_usec = m->initrd_timestamp.monotonic - m->kernel_timestamp.monotonic;
                         initrd_usec = m->userspace_timestamp.monotonic - m->initrd_timestamp.monotonic;
 
-                        if (!log_on_console())
-                                log_struct(LOG_INFO,
-                                           MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
-                                           "KERNEL_USEC="USEC_FMT, kernel_usec,
-                                           "INITRD_USEC="USEC_FMT, initrd_usec,
-                                           "USERSPACE_USEC="USEC_FMT, userspace_usec,
-                                           "MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
-                                           format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
-                                           format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
-                                           format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
-                                           format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
-                                           NULL);
+                        log_struct(LOG_INFO,
+                                   MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
+                                   "KERNEL_USEC="USEC_FMT, kernel_usec,
+                                   "INITRD_USEC="USEC_FMT, initrd_usec,
+                                   "USERSPACE_USEC="USEC_FMT, userspace_usec,
+                                   "MESSAGE=Startup finished in %s (kernel) + %s (initrd) + %s (userspace) = %s.",
+                                   format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
+                                   format_timespan(initrd, sizeof(initrd), initrd_usec, USEC_PER_MSEC),
+                                   format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
+                                   format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
+                                   NULL);
                 } else {
                         kernel_usec = m->userspace_timestamp.monotonic - m->kernel_timestamp.monotonic;
                         initrd_usec = 0;
 
                 } else {
                         kernel_usec = m->userspace_timestamp.monotonic - m->kernel_timestamp.monotonic;
                         initrd_usec = 0;
 
-                        if (!log_on_console())
-                                log_struct(LOG_INFO,
-                                           MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
-                                           "KERNEL_USEC="USEC_FMT, kernel_usec,
-                                           "USERSPACE_USEC="USEC_FMT, userspace_usec,
-                                           "MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
-                                           format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
-                                           format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
-                                           format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
-                                           NULL);
-                }
-        } else {
-                firmware_usec = loader_usec = initrd_usec = kernel_usec = 0;
-                total_usec = userspace_usec = m->finish_timestamp.monotonic - m->userspace_timestamp.monotonic;
-
-                if (!log_on_console())
                         log_struct(LOG_INFO,
                                    MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
                         log_struct(LOG_INFO,
                                    MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
+                                   "KERNEL_USEC="USEC_FMT, kernel_usec,
                                    "USERSPACE_USEC="USEC_FMT, userspace_usec,
                                    "USERSPACE_USEC="USEC_FMT, userspace_usec,
-                                   "MESSAGE=Startup finished in %s.",
+                                   "MESSAGE=Startup finished in %s (kernel) + %s (userspace) = %s.",
+                                   format_timespan(kernel, sizeof(kernel), kernel_usec, USEC_PER_MSEC),
+                                   format_timespan(userspace, sizeof(userspace), userspace_usec, USEC_PER_MSEC),
                                    format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
                                    NULL);
                                    format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
                                    NULL);
+                }
+        } else {
+                firmware_usec = loader_usec = initrd_usec = kernel_usec = 0;
+                total_usec = userspace_usec = m->finish_timestamp.monotonic - m->userspace_timestamp.monotonic;
+
+                log_struct(LOG_INFO,
+                           MESSAGE_ID(SD_MESSAGE_STARTUP_FINISHED),
+                           "USERSPACE_USEC="USEC_FMT, userspace_usec,
+                           "MESSAGE=Startup finished in %s.",
+                           format_timespan(sum, sizeof(sum), total_usec, USEC_PER_MSEC),
+                           NULL);
         }
 
         SET_FOREACH(u, m->startup_units, i)
         }
 
         SET_FOREACH(u, m->startup_units, i)