CentOS 7 timedatectl does not work properly with chronyd
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
Related videos on Youtube
3bdalla
Updated on September 18, 2022Comments
-
3bdalla almost 2 years
In order to have
timedatectl
NTP enabled and synchronized to beyes
, I had to disablechronyd
, stopntpd
, perfromntpdate
, then startntpd
. After that I can get NTP enabled and synchronized intimedatectl
. For both/etc/chrony.conf
and/etc/ntp.conf
I haveserver <server-ip> prefer iburst
nothing else.- Is there any problem with this situation?
- Is there a way to force
chrony
to manually sync? Something similar tontpdate
?