Re: Testing if timesyncd is synced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mi, 20.02.19 11:18, Mantas Mikulėnas (grawity@xxxxxxxxx) wrote:

> Call adjtimex(2) and check whether buf.status has STA_UNSYNC (should be
> unset when clock is synchronized).
>
> The systemd-timedated helper service (org.freedesktop.timedate1) exposes
> the same flag as the org.freedesktop.timedate1.NTPSynchronized property on
> /org/freedesktop/timedate1.

Adding to this:

"timedatectl" shows this in a user friendly way btw.

"busctl get-property org.freedesktop.timedate1
/org/freedesktop/timedate1 org.freedesktop.timedate1 NTPSynchronized"
is a nice way to get this problematically in a shell parsable fashion.

> (That said, this deliberately won't work if you've configured timesyncd to
> use "local time" instead of UTC, as timesyncd doesn't want to activate RTC
> updates in that mode.)

It's not that we don't want to. The kernel's "11min" mode doesn't do
that in that case, iirc. i.e. timesyncd isn't the one syncing stuff
down, it's the kernel on its own.

Lennart

--
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux