7

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

1 Answer 1

10
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.

3
  • thanks, very helpful. I read the systemd list quote on the arch linux wiki entry and it's impresive and misleading (as usual one might say), pretending that the 'full NTP functionality' it 'doesn't bother with' only concerns NTP server functions. when it reality they regress clock handling to a Windows XP state of the art, with one added useful feature. And of course I would not be here if it at least worked well as a SNTP client, because then I'd probably not have cared on that box. Commented Aug 27 at 16:10
  • The only optimistic thing that can come out of this is that maybe there will be a new market segment between the underutilized high end carrier grade distros (the few that are left) and focussed lean ones like Alpine, sidestepping the whole idea of COTS distros for something one can easily use for safety critical systems - but with a wider distribution. I know, I know, soon my alarm is gonna ring and I'll wake up from that dream. Commented Aug 27 at 16:20
  • 2025 answer, look at the ntpd-rs package (in debian, so presume ubuntu). Rust NTPD. Commented Sep 11 at 9:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.