journal: ensure open journals from find_journal() (#3973)
authorVito Caputo <vcaputo@gnugeneration.com>
Wed, 17 Aug 2016 12:51:07 +0000 (05:51 -0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Aug 2016 12:51:07 +0000 (14:51 +0200)
commit105bdb46b4ac7eb658a2f27727216591d0bfe267
tree66cc2ff66a85db0a2f36b8104a4ae21a9fb08858
parenta5110c90303cf455db5062faef34d5724d12e2e9
journal: ensure open journals from find_journal() (#3973)

If journals get into a closed state like when rotate fails due to
ENOSPC, when space is made available it currently goes unnoticed leaving
the journals in a closed state indefinitely.

By calling system_journal_open() on entry to find_journal() we ensure
the journal has been opened/created if possible.

Also moved system_journal_open() up to after open_journal(), before
find_journal().

Fixes https://github.com/systemd/systemd/issues/3968
src/journal/journald-server.c