From: Dimitri John Ledkov Date: Fri, 3 Jul 2015 10:34:12 +0000 (+0100) Subject: journal: in persistent mode create /var/log/journal, with all parents. X-Git-Tag: v222~35^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F484%2Fhead;p=thirdparty%2Fsystemd.git journal: in persistent mode create /var/log/journal, with all parents. systemd-journald races with systemd-tmpfiles-setup, and hence both are started at about the same time. On a bare-bones system (e.g. with empty /var, or even non-existent /var), systemd-tmpfiles will create /var/log. But it can happen too late, that is systemd-journald already attempted to mkdir /var/log/journal, ignoring the error. Thus failing to create /var/log/journal. One option, without modifiying the dependency graph is to create /var/log/journal directory with parents, when persistent storage has been requested. --- diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index f7402984afd..46358e1c1a6 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -943,7 +943,7 @@ static int system_journal_open(Server *s, bool flush_requested) { * the machine path */ if (s->storage == STORAGE_PERSISTENT) - (void) mkdir("/var/log/journal/", 0755); + (void) mkdir_p("/var/log/journal/", 0755); fn = strjoina("/var/log/journal/", ids); (void) mkdir(fn, 0755);