From: Lennart Poettering Date: Mon, 12 Jun 2023 12:06:10 +0000 (+0200) Subject: man: explain timesyncd epoch mtime touch files in a bit more detail X-Git-Tag: v254-rc1~231 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2efddcb24551521b75542043d033e39338207de8;p=thirdparty%2Fsystemd.git man: explain timesyncd epoch mtime touch files in a bit more detail Let's mention what /usr/lib/clock-epoch precisely does, and underline we only *advance* the time based on it. Inspired by Darkdragon-001's #23214. Replaces #23214 --- diff --git a/man/systemd-timesyncd.service.xml b/man/systemd-timesyncd.service.xml index 34e0a674720..45fb6b716f1 100644 --- a/man/systemd-timesyncd.service.xml +++ b/man/systemd-timesyncd.service.xml @@ -75,14 +75,27 @@ /var/lib/systemd/timesync/clock - The modification time ("mtime") of this file is updated on each successful NTP synchronization - or after each SaveIntervalSec= time interval, as specified in - timesyncd.conf5. - At the minimum, it will be set to the systemd build date. It is used to ensure that the system clock - remains roughly monotonic across reboots, in case no local RTC is available. + The modification time ("mtime") of this file is updated on each successful NTP + synchronization or after each SaveIntervalSec= time interval, as specified in + timesyncd.conf5. + + When initializing, the local clock is advanced to the modification time of this file (if the + file timestamp is in the past this adjustment is not made). If the file does not exist yet, the + clock is instead advanced to the modification time of /usr/lib/clock-epoch – + if it exists – or to a time derived from the source tree at build time. This mechanism is used to + ensure that the system clock remains somewhat reasonably initialized and roughly monotonic across + reboots, in case no battery-buffered local RTC is available. + + /usr/lib/clock-epoch + + The modification time ("mtime") of this file is used for advancing the system clock + in case /var/lib/systemd/timesync/clock does not exist yet, see + above. + + /run/systemd/timesync/synchronized