<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 28, 2020, 10:06 Ulrich Windl <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>>> Mark Corbin <<a href="mailto:mark@dibsco.co.uk" target="_blank" rel="noreferrer">mark@dibsco.co.uk</a>> schrieb am 27.08.2020 um 12:33 in<br>
Nachricht<br>
<<a href="mailto:c2edc2b5-0c6a-2d34-42ff-569c2626294a@dibsco.co.uk" target="_blank" rel="noreferrer">c2edc2b5-0c6a-2d34-42ff-569c2626294a@dibsco.co.uk</a>>:<br>
> Hello<br>
> <br>
> I am working on time synchronisation issues at boot for systems without <br>
> an RTC (using balenaOS on a Raspberry Pi 3) and have some questions <br>
> about how journald assigns timestamps to log messages.<br>
> <br>
> When I boot my system and look at the journal I see an initial date/time <br>
> for kernel messages, e.g. '1 June 2020 10:00:00' followed by messages <br>
> with the 'correct' date/time once the system time has been set from <br>
> another source, e.g. build time, NTP, etc. This means that over several <br>
> reboots I have lots of sets of log messages from 1 June 2020 which <br>
> understandably confuses the 'journalctl ‑‑list‑boots' command. I found <br>
> an issue that describes the problem here <br>
> <a href="https://github.com/systemd/systemd/issues/662" rel="noreferrer noreferrer" target="_blank">https://github.com/systemd/systemd/issues/662</a> and had assumed that there <br>
> wasn't anything I could do about this.<br>
<br>
"Good old UNIX" had the feature to "guess" the current time by looking at the<br>
last update in the root filesystem (when that seemed newer than the "current<br>
time").<br>
One idea would be to have a "timestamp file" (much like a low-resolution<br>
software RTC) that is updated periodically when it's known that the system time<br>
is correct. Then after boot you would get a good guess, and time wouldn't jump<br>
backwards, too.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I believe systemd already does that, although I keep forgetting the details – not sure if it's part of core or if it's part of systemd-timesyncd.</div><div dir="auto"><br></div></div>