问题原文
原帖链接 · John doe · CC BY-SA 4.0
I have installed ntp on ubuntu 16.04 but when I run timedatectl it doesn't show NTP. It shows systemd-timesyncd in the output.
I ran the command sudo systemctl disable systemd-timesyncd; sudo systemctl stop systemd-timesyncd; sudo systemctl enable ntp;
How do I set ntp for timedatectl?
I even tried timedatectl set-ntp true but still it doesn't show under timedatectl output.
root@host001:~# timedatectl
Local time: Fri 2020-05-08 16:00:59 UTC
Universal time: Fri 2020-05-08 16:00:59 UTC
RTC time: Fri 2020-05-08 16:00:59
Time zone: UTC (UTC, +0000)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
I was expecting output like below (as seen in others post) where NTP is shown instead of systemd-timesyncd
Local time: Fri 2020-05-08 16:00:59 UTC
Universal time: Fri 2020-05-08 16:00:59 UTC
RTC time: Fri 2020-05-08 16:00:59
Time zone: UTC (UTC, +0000)
Network time on: no
NTP synchronized: yes
RTC in local TZ: no
已采纳解答
原帖链接 · John Mahowald · CC BY-SA 4.0
systemctl disable --now systemd-timesyncd
systemctl enable --now ntp
Or as Ubuntu and Red Hat are dismissing ntpd as legacy for some reason, chrony is an option
systemctl enable --now chrony
Read the timedatectl man page, (this version of) set-ntp only controls systemd-timesyncd. Being a SNTP client, it won't discipline the system clock like a proper NTP. I consider this command a little misleading, and manage the time sync service units directly.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
