mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
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.
This commit is contained in:
parent
fcba531ed4
commit
00a1686189
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user