Hi,
]# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)
]# uname -r
4.18.0-147.3.1.el8_1.x86_64
]# rpm -qa | grep chrony
chrony-3.5-1.el8.x86_64
I've been working with dbus and org.freedesktop.timedate1. If I purposefully stop my upstream NTP server that my chrony client is synchronizing to, the NTPSynchronized property never seems to get updated to reflect this.
]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? head.cluster 3 6 0 636 -29us[ +95ns] +/- 8964us
So the single NTP source is clearly unreachable in this scenario. Yet, I will still see NTPSynchronized in DBUS.
# gdbus introspect --system --dest org.freedesktop.timedate1 --object-path /org/freedesktop/timedate1 | grep NTPSynchronized
readonly b NTPSynchronized = true;
Timedatectl shows the same.
]# timedatectl
...
System clock synchronized: yes
NTP service: active
And within chrony, it doesn't update leap status. Or show the server as down in the activity report.
]# chronyc tracking | grep ^Leap
Leap status : Normal
]# chronyc activity
200 OK
1 sources online
0 sources offline
0 sources doing burst (return to online)
0 sources doing burst (return to offline)
0 sources with unknown address
This behavior seems indefinite, until I restart the client side chronyd service.
]# systemctl restart chronyd
]# gdbus introspect --system --dest org.freedesktop.timedate1 --object-path /org/freedesktop/timedate1 | grep NTPSynchronized
readonly b NTPSynchronized = false;
]# chronyc tracking | grep ^Leap
Leap status : Not synchronised
]# chronyc activity
200 OK
1 sources online
0 sources offline
]# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? head.cluster 0 8 0 - +0ns[ +0ns] +/- 0ns
If I bring the NTP source online, then restart the chronyd client, it will properly update to show not synchronized, then eventually synchronized. The sync state appears to only get updated during the chronyd service startup sequence though.
I really liked the idea of being able to easily show the NTP synchronization status, and this is already done in the Cockpit GUI 'system' tab. Cockpit appears to use the same DBUS value though, because it is not updating properly either.
If there is a configuration setting to force chronyd to update at intervals, without restarting the service, please let me know. I looked through all of the config options but nothing stood out.
Thank you,
Jordan Gibbens
Systems Engineer
Advanced Clustering Technologies, Inc,