From 94b6551662e0db8eb09768ed70f77759f322b4c6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 11 Nov 2015 12:59:09 +0100 Subject: journalctl: add new --sync switch for syncing the journal to disk With this new "--sync" switch we add a synchronous way to sync everything queued to disk, and return only after that's complete. This command gives the guarantee that anything queued before has hit the disk before the command returns. While we are at it, also improve the man pages and help text for journalctl a bit. --- man/journalctl.xml | 24 +++++++++++++++++++++--- man/systemd-journald.service.xml | 23 +++++++++++++++++++---- 2 files changed, 40 insertions(+), 7 deletions(-) (limited to 'man') diff --git a/man/journalctl.xml b/man/journalctl.xml index a3192539dc..2160f3cba2 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -772,14 +772,32 @@ the operation. + + + + Ask the journal daemon to write all yet + unwritten journal data to the backing file system and + synchronize all journals. This call does not return until the + operation is complete. This command guarantees that any log + messages written before its invocation are safely stored on + disk at the time it returns. + + Asks the journal daemon to flush any log data stored in /run/log/journal into - /var/log/journal, if persistent storage is - enabled. This call does not return until the operation is - complete. + /var/log/journal, if persistent storage + is enabled. This call does not return until the operation is + complete. Note that this call is idempotent: the data is only + flushed from /run/log/journal into + /var/log/journal once during system + runtime, and this command exits cleanly without executing any + operation if this has already has happened. This command + effectively guarantees that all data is flushed to + /var/log/journal at the time it + returns. diff --git a/man/systemd-journald.service.xml b/man/systemd-journald.service.xml index 21fd684b8b..f1054b03bb 100644 --- a/man/systemd-journald.service.xml +++ b/man/systemd-journald.service.xml @@ -131,15 +131,30 @@ systemd-tmpfiles --create --prefix /var/log/journal this is enabled). This must be used after /var/ is mounted, as otherwise log data from /run is never flushed to - /var regardless of the - configuration. + /var regardless of the configuration. The + journalctl --flush command uses this signal + to request flushing of the journal files, and then waits for + the operation to complete. See + journalctl1 + for details. SIGUSR2 Request immediate rotation of the journal - files. + files. The journalctl --rotate command uses + this signal to request journal file + rotation. + + + + SIGRTMIN+1 + + Request that all unwritten log data is written + to disk. The journalctl --sync command uses + this signal to trigger journal synchronization, and then waits + for the operation to complete. @@ -261,7 +276,7 @@ systemd-tmpfiles --create --prefix /var/log/journal systemd-coredump8, setfacl1, sd_journal_print4, - pydoc systemd.journal. + pydoc systemd.journal -- cgit v1.2.3-54-g00ecf