1

I'm wondering how I can get timedatectl to show that NTP is enabled in CentOS 7

root@voip:~ $ timedatectl
      Local time: Tue 2016-10-18 20:58:23 EDT
  Universal time: Wed 2016-10-19 00:58:23 UTC
        RTC time: Wed 2016-10-19 00:58:23
       Time zone: America/New_York (EDT, -0400)
     NTP enabled: no ##THIS LINE##
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2016-03-13 01:59:59 EST
                  Sun 2016-03-13 03:00:00 EDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2016-11-06 01:59:59 EDT
                  Sun 2016-11-06 01:00:00 EST
2
timedatectl set-ntp true

needs a (secure) ntp client to synchronize time via systemd.

systemd from v213 supports "systemd-timesyncd" but in latest version of systemd on CentOS 7, they have decided to disable it. I am current on 7.7.1908 and systemd-timesyncd does not exist.

That means two things:

  • If your distro supports systemd-timesyncd, you can disable chrony and enable systemd-timesyncd
  • If it does not, you should install a (secure) ntp client (like chrony but there are also other options).

Only then you can indeed set ntp true in timedatectl.

  • This makes sense based on the other two answers, so the real culprit was me using my own NTP server vs a secure one – FreeSoftwareServers Sep 21 '19 at 10:36
5

Well, its because of Chrony. (RHEL 7 new NTP Server)

First

yum remove chrony

Then

timedatectl set-ntp true

Not sure what effect this has other then making me happy with timedatectl, everything else said it was working, but I have an XYMon script for NTP which greps that line. Suppose thats the point of the script, it was red because it was telling me something was wrong!

  • Thanks! This worked for me. A downstream NTP client was reporting that it was getting no NTP input, and this helped track it down. – Jason Oct 15 '17 at 2:02
1

On CentOS 7.3.1611, I faced the same problem but had to do the reverse:

$ sudo yum install chrony
$ sudo timedatectl set-ntp true

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.