[systemd-commits] src/journal

Lennart Poettering lennart at kemper.freedesktop.org
Thu Sep 12 09:19:31 PDT 2013


 src/journal/journald-server.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 00a168618906bea43c3c57e20b9152582c324bf8
Author: Olivier Brunel <jjk at jjacky.com>
Date:   Thu Sep 12 14:37:30 2013 +0200

    journald: Log error when failed to get machine-id on start
    
    Can help since the journal requires /etc/machine-id to exists in order to start,
    and will simply silently exit when it does not.

diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 9daeb6e..ba211b3 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -897,8 +897,10 @@ static int system_journal_open(Server *s) {
         char ids[33];
 
         r = sd_id128_get_machine(&machine);
-        if (r < 0)
+        if (r < 0) {
+                log_error("Failed to get machine id: %s", strerror(-r));
                 return r;
+        }
 
         sd_id128_to_string(machine, ids);
 
@@ -1000,10 +1002,8 @@ int server_flush_to_var(Server *s) {
         log_debug("Flushing to /var...");
 
         r = sd_id128_get_machine(&machine);
-        if (r < 0) {
-                log_error("Failed to get machine id: %s", strerror(-r));
+        if (r < 0)
                 return r;
-        }
 
         r = sd_journal_open(&j, SD_JOURNAL_RUNTIME_ONLY);
         if (r < 0) {



More information about the systemd-commits mailing list