ntp
I remember looking at this circa 2016 - 2021 and letting go at that time, crony had just been released and systemd was still relatively new at that time.
systemd commands
- sudo systemctl status systemd-timesyncd
- The default configuration is shown in
/etc/systemd/timesyncd.conf(All the defaults are shown commented out) - Copy the default configuration in
/etc/systemd/timesyncd.confto/etc/systemd/timesyncd.conf.d/timesyncd.confand modify options in/etc/systemd/timesyncd.conf.d/timesyncd.conf
- timedatectl timesync-status
ntp servers
ntp servers can be checked using the ntpdate command, which can be loaded in Debian with sudo apt install ntpsec-ntpdate
chronyc
chronyc can be used to query chronyd. The following are some key queries. Note chrony help will provide a list of available commands.
sources -vwill list information about the current sourcestrackingDisplay system time informationnptdatadisplay information about last valid measurementactivitycheck how many NTP sources are online/offlineserverstatsDisplay statistics of the serverauthdata -vDisplay information about authentication
docker exec -ti chrony /bin/shto get shell access to container
pool pool.ntp.org iburst initstepslew 10 pool.ntp.org driftfile /var/lib/chrony/chrony.drift rtcsync cmdport 0</code>++++
Reference
- cturra/ntp (crony docker example)