[systemd-devel] Antw: [EXT] Journal message timestamps

Mantas Mikulėnas grawity at gmail.com
Fri Aug 28 07:48:18 UTC 2020


On Fri, Aug 28, 2020, 10:06 Ulrich Windl <Ulrich.Windl at rz.uni-regensburg.de>
wrote:

> >>> Mark Corbin <mark at dibsco.co.uk> schrieb am 27.08.2020 um 12:33 in
> Nachricht
> <c2edc2b5-0c6a-2d34-42ff-569c2626294a at dibsco.co.uk>:
> > Hello
> >
> > I am working on time synchronisation issues at boot for systems without
> > an RTC (using balenaOS on a Raspberry Pi 3) and have some questions
> > about how journald assigns timestamps to log messages.
> >
> > When I boot my system and look at the journal I see an initial date/time
> > for kernel messages, e.g. '1 June 2020 10:00:00' followed by messages
> > with the 'correct' date/time once the system time has been set from
> > another source, e.g. build time, NTP, etc. This means that over several
> > reboots I have lots of sets of log messages from 1 June 2020 which
> > understandably confuses the 'journalctl ‑‑list‑boots' command. I found
> > an issue that describes the problem here
> > https://github.com/systemd/systemd/issues/662 and had assumed that
> there
> > wasn't anything I could do about this.
>
> "Good old UNIX" had the feature to "guess" the current time by looking at
> the
> last update in the root filesystem (when that seemed newer than the
> "current
> time").
> One idea would be to have a "timestamp file" (much like a low-resolution
> software RTC) that is updated periodically when it's known that the system
> time
> is correct. Then after boot you would get a good guess, and time wouldn't
> jump
> backwards, too.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20200828/e8cbda95/attachment.htm>


More information about the systemd-devel mailing list