journalctl: never fail at flushing when the flushed flag is set
authorFranck Bui <fbui@suse.com>
Wed, 4 Aug 2021 09:20:07 +0000 (11:20 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Sep 2021 13:10:15 +0000 (15:10 +0200)
commitf6fca35e642a112e80cc9bddb9a2b4805ad40df2
tree4b1785d1650a125eee9aa7326678624e6df3920e
parente236711fd7815eb93690d166959660c7d82666bf
journalctl: never fail at flushing when the flushed flag is set

Even if journald was not running, flushing the volatile journal used to work if
the journal was already flushed (ie the flushed flag
/run/systemd/journald/flushed was created).

However since commit 4f413af2a0a, this behavior changed and now '--flush' fails
because it tries to contact journald without checking the presence of the
flushed flag anymore.

This patch restores the previous behavior since there's no reason to fail when
journalctl can figure out that the flush is not necessary.
src/journal/journalctl.c