From dbd6e31cf91ab86a4a2fffeb50ccef211da3126d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Nov 2015 13:56:54 +0100 Subject: 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. --- src/journal/journald-server.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/journal/journald-server.c') 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; } -- cgit v1.2.3-54-g00ecf