<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Wed, Feb 20, 2019 at 10:55 AM Paul D. DeRocco <<a href="mailto:pderocco@ix.netcom.com">pderocco@ix.netcom.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">What's the simplest way to test if systemd-timesyncd is currently synced<br>
to the network, from within an embedded application (running with root<br>
privileges)? Is there some single dbus transaction that will give me this<br>
answer?<br></blockquote><div><br></div><div>Call adjtimex(2) and check whether buf.status has STA_UNSYNC (should be unset when clock is synchronized).</div><div><br></div><div>The systemd-timedated helper service (org.freedesktop.timedate1) exposes the same flag as the org.freedesktop.timedate1.NTPSynchronized property on /org/freedesktop/timedate1.</div><div><br></div><div>(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.)</div><div><br></div><div>timesyncd itself exposes several properties including the actual received NTPMessage, but I'm not sure if it's as good as an explicit indication. It does emit update signals however.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div></div></div>