]> git.ipfire.org Git - thirdparty/systemd.git/commit
journald: rework --sync/--rotate logic to use CLOCK_MONOTONIC timestamp files
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 10:17:01 +0000 (11:17 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Nov 2015 10:17:01 +0000 (11:17 +0100)
commit33d52ab92f2f0bfd706e6f343d172618d1e03f3d
tree15f21659f2e23491ef6dd7d390fde2945d9302d4
parentb97e7fabaeaf12c88d6a10b2bfead54a77812105
journald: rework --sync/--rotate logic to use CLOCK_MONOTONIC timestamp files

Previously, we'd rely on the mtime timestamps of the touch files to see
if our sync/rotation requests were already suppressed. This means we
rely on CLOCK_REALTIME timestamps. With this patch we instead store the
CLOCK_MONOTONIC timestamp *in* the touch files, and avoid relying on
mtime.

This should make things more reliable when the clock or underlying mtime
granularity is not very good.

This also adds warning messages if writing any of the flag files fails.
src/basic/fileio.c
src/basic/fileio.h
src/journal/journalctl.c
src/journal/journald-server.c