Commit
74055aa762 'journalctl: add new --flush command and make use of
it in systemd-journal-flush.service' broke flushing because journald
checks for the /run/systemd/journal/flushed file before opening the
permanent journal. When the creation of this file was postponed,
flushing stoppage ensued.
-static int system_journal_open(Server *s) {
+static int system_journal_open(Server *s, bool flush_requested) {
int r;
char *fn;
sd_id128_t machine;
int r;
char *fn;
sd_id128_t machine;
if (!s->system_journal &&
(s->storage == STORAGE_PERSISTENT || s->storage == STORAGE_AUTO) &&
if (!s->system_journal &&
(s->storage == STORAGE_PERSISTENT || s->storage == STORAGE_AUTO) &&
- access("/run/systemd/journal/flushed", F_OK) >= 0) {
+ (flush_requested
+ || access("/run/systemd/journal/flushed", F_OK) >= 0)) {
/* If in auto mode: first try to create the machine
* path, but not the prefix.
/* If in auto mode: first try to create the machine
* path, but not the prefix.
if (!s->runtime_journal)
return 0;
if (!s->runtime_journal)
return 0;
- system_journal_open(s);
+ system_journal_open(s, true);
if (!s->system_journal)
return 0;
if (!s->system_journal)
return 0;
server_cache_boot_id(s);
server_cache_machine_id(s);
server_cache_boot_id(s);
server_cache_machine_id(s);
- r = system_journal_open(s);
+ r = system_journal_open(s, false);