summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 00:28:17 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-23 00:39:42 +0200
commit74055aa76278232ff05574fc47c4e6b3560554a7 (patch)
treecebf74b2f97108dc325ce4522962863b2b4c2f35 /src/journal/journald-server.c
parent0e2f14014c65b4d8b30146e414579154cfa932da (diff)
journalctl: add new --flush command and make use of it in systemd-journal-flush.service
This new command will ask the journal daemon to flush all log data stored in /run to /var, and wait for it to complete. This is useful, so that in case of Storage=persistent we can order systemd-tmpfiles-setup afterwards, to ensure any possibly newly created directory in /var/log gets proper access mode and owners.
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index bf9cfcccc9..991f4f2a38 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1221,11 +1221,12 @@ static int dispatch_sigusr1(sd_event_source *es, const struct signalfd_siginfo *
log_info("Received request to flush runtime journal from PID %"PRIu32, si->ssi_pid);
- touch("/run/systemd/journal/flushed");
server_flush_to_var(s);
server_sync(s);
server_vacuum(s);
+ touch("/run/systemd/journal/flushed");
+
return 0;
}