summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorOlivier Brunel <jjk@jjacky.com>2013-09-12 14:37:30 +0200
committerLennart Poettering <lennart@poettering.net>2013-09-12 18:19:16 +0200
commit00a168618906bea43c3c57e20b9152582c324bf8 (patch)
tree0e07980205aef30553a515f38366a7e7e5fd6bec /src/journal
parentfcba531ed4c6e6f8f21d8ca4e3a56e3162b1c578 (diff)
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.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 9daeb6e9e7..ba211b3724 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) {