summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-11 13:56:54 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-11 14:29:10 +0100
commitdbd6e31cf91ab86a4a2fffeb50ccef211da3126d (patch)
tree9f97ae27e0bf78cbb1b73260e4e88a8f2afc6eee /src/journal/journald-server.c
parent94b6551662e0db8eb09768ed70f77759f322b4c6 (diff)
journalctl: make --rotate synchronous, too
Of course, ideally we'd just use normal synchronous bus calls, but this is out of the question as long as we rely on dbus-daemon (which logs to journald, and thus cannot use to avoid cyclic sync loops). Hence, instead, reuse the wait logic already implemented for --sync, and use a signal in one direction, and a mtime watch file for the reply.
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index f0a3c82d98..70ff101d5f 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1263,6 +1263,9 @@ static int dispatch_sigusr2(sd_event_source *es, const struct signalfd_siginfo *
server_rotate(s);
server_vacuum(s, true, true);
+ /* Let clients know when the most recent rotation happened. */
+ (void) touch("/run/systemd/journal/rotated");
+
return 0;
}