]> git.ipfire.org Git - thirdparty/systemd.git/commit
manager: use max of: compile epoch, epoch file, timesyncd file
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Jun 2024 10:50:52 +0000 (12:50 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 Jun 2024 14:20:12 +0000 (16:20 +0200)
commited23f7cbcb5457be32a5fc133280fb56bfe043d2
tree6e01016cb5040d503a6fdc68e86e757becc7baa9
parent18c5979465f4d4f60fbc8ed34d98f14a257bb1ff
manager: use max of: compile epoch, epoch file, timesyncd file

Previously systemd would not use /var/lib/systemd/timesync/clock. This means
that even if /var/ is mounted when systemd is started and the file is
available, we would potentially make one time jump and than another time jump.
From a user's POV, this doesn't seem useful at all.

Also, we would always let /usr/lib/clock-epoch take priority over the built-in
epoch. But there is no guarantee that this file is actually fresh. In
particular, a user may touch /usr/lib/clock-epoch to work around a broken clock
during installation (as recommended in [1]), and then this file will grow stale
over time.

So just load the three timestamps and use the highest one as the epoch.

[1] https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403
src/core/clock-warp.c