1

In order to have timedatectl NTP enabled and synchronized to be yes, I had to disable chronyd, stop ntpd, perfrom ntpdate, then start ntpd. After that I can get NTP enabled and synchronized in timedatectl. For both /etc/chrony.conf and /etc/ntp.conf I have server <server-ip> prefer iburst nothing else.

  1. Is there any problem with this situation?
  2. Is there a way to force chrony to manually sync? Something similar to ntpdate?
1

timedatectl works with any ntp client (like chrony). systemd supports systemd-timesyncd from v213 but in latest version of CentOS 7 (I am currently on 7.7.1908) they have decided to disabled it.

If you want to use an ntp client instead of timedatectl then I would propose to use cron. @daily should do the job.

eg.

@daily /usr/sbin/ntpdate -u gr.pool.ntp.org

But you can always install chrony and just set ntp true to timedatectl

# timedatectl set-ntp true 
Failed to set ntp: NTP not supported

# yum -y install chrony

# timedatectl set-ntp true

# timedatectl | grep NTP                                 
     NTP enabled: yes          
NTP synchronized: no

and if you enable chrony service, then you will see that timedatectl has also synced NTP

# systemctl enable chronyd
# systemctl start chronyd

# timedatectl | grep -i ntp
     NTP enabled: yes
NTP synchronized: yes
0

timedatectl only works with systemd own NTP daemon (systemd-timesyncd), if you are using an other NTP daemon you must use the tools shipped by them (chronyc, ntpq,....)

You definitely shouldn't have multiple NTP daemons running at the same time on your machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.