1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-10 17:57:40 +03:00

journald: debug log when we cannot read the machine ID

This commit is contained in:
Lennart Poettering 2018-10-25 18:35:39 +02:00
parent 6812765891
commit e859154447

View File

@ -252,8 +252,9 @@ static int open_journal(
bool seal,
JournalMetrics *metrics,
JournalFile **ret) {
int r;
JournalFile *f;
int r;
assert(s);
assert(fname);
@ -399,14 +400,16 @@ static JournalFile* find_journal(Server *s, uid_t uid) {
if (uid_for_system_journal(uid))
return s->system_journal;
r = sd_id128_get_machine(&machine);
if (r < 0)
return s->system_journal;
f = ordered_hashmap_get(s->user_journals, UID_TO_PTR(uid));
if (f)
return f;
r = sd_id128_get_machine(&machine);
if (r < 0) {
log_debug_errno(r, "Failed to determine machine ID, using system log: %m");
return s->system_journal;
}
if (asprintf(&p, "/var/log/journal/" SD_ID128_FORMAT_STR "/user-"UID_FMT".journal",
SD_ID128_FORMAT_VAL(machine), uid) < 0)
return s->system_journal;