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)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 12 Oct 2021 15:00:32 +0000 (17:00 +0200)
commitdc331f4c9268d17a66f4393cfd0dba14c7022d41
treeccc9cf61f03dce8c19f83182987427e9c5291a26
parent9d6a6c8a104122cb41667fb1e1e67731838b51cf
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.

(cherry picked from commit f6fca35e642a112e80cc9bddb9a2b4805ad40df2)
src/journal/journalctl.c