3

RedHat release 7.3 This is a development machine, so I do not know its installation history. It was noticed that it did not keep its time synced very well, although ntpd is running.

My investigations revealed that ntp is working fine but there is another service running that is also updating the time - unfortunately that service is 12 minutes fast!

For example, I disable ntpd and run ntpdate. The computers time is reset.

#timedatectl status

      Local time: Tue 2016-11-22 13:27:56 GMT
  Universal time: Tue 2016-11-22 13:27:56 UTC
        RTC time: Tue 2016-11-22 13:27:17
       Time zone: Europe/London (GMT, +0000)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no

but within a couple of minutes the time goes back to being 12 minutes fast (compare with RTC)

#timedatectl status

      Local time: Tue 2016-11-22 13:41:09 GMT
  Universal time: Tue 2016-11-22 13:41:09 UTC
        RTC time: Tue 2016-11-22 13:28:49
       Time zone: Europe/London (GMT, +0000)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no

I found some relevant messages in /var/log/messages

*Nov 22 14:26:00 development systemd: Time has been changed
 Nov 22 14:38:27 development systemd: Time has been changed
*Nov 22 14:27:00 development systemd: Time has been changed
 Nov 22 14:39:27 development systemd: Time has been changed
*Nov 22 14:27:00 development systemd: Time has been changed
 Nov 22 14:40:27 development systemd: Time has been changed
*Nov 22 14:39:00 development systemd: Time has been changed
 Nov 22 14:42:27 development systemd: Time has been changed

The ones marked "*" are where I have done a date 11221426.

You can see something somewhere resets the time back to being 12 minutes fast. Note the time is always "27 seconds" so it seems to run once a minute, although this slowly drifts (currently running at 28 seconds!).

I spent a long time disabling services but I have not been able to find the one that is forcing my machine to be 12 minutes in the future. ntpd is disabled, but I know that one syncs to the correct time.

Please can anyone suggest any other time updating services that I could check to see if they are running.

Additional information

As suggested in the answers, I looked at chronyd. It was not running on my machine, and even if I have it running it sets the machine to the right time, not 12 minutes fast.

chronyd.service - NTP client/server
Loaded: loaded 
   (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled)
Active: inactive (dead)
5

Red Hat version-7 introduced the chronyddaemon for system clock management. It can be used in lieu of the ntpd daemon. chronyd is favored for systems that may intermittently disconnect from a network. chronyd can adjust the system time much faster than ntpd.

To see if this daemon is running, do:

# systemctl status chronyd

To determine how the daemon is operating:

# chronyc tracking
# chronyc sources

Configuration is controlled via /etc/chrony.conf.

  • Good answer, but not the right one in my case! I certainly have chronyd lurking on the machine, but inactive. When I enabled it, it reset my clock to the correct time, but within a minute my nemesis rogue program put the clock 12 minutes fast again. – MortimerCat Nov 23 '16 at 9:16
  • 1
    Do you have openntpd installed and running? Check with systemctl status openntpd. – JRFerguson Nov 23 '16 at 15:46
  • openntpd not installed – MortimerCat Nov 23 '16 at 16:46
2

I did not think to mention that the machine was running under VMware, which is where the problem was. VMware tools has the option of time syncing although they recommend that you use ntp instead.

In my case, timesync was enabled and the virtual machine was 12 minutes fast. So whenever I corrected the time, vmware tools kicked in and reverted my change. Plus, 12 minutes is too much for ntpd to handle so ntpd gave up.

For the record, to see if vmware time sync is running...

#vmware-toolbox-cmd timesync status
Enabled

Yes, it was enabled. To disable....

#sudo vmware-toolbox-cmd timesync disable
Disabled

No more inaccurate updates! Note, I am not familiar with the VMware setup, so I am not sure if it will be re-enabled after a reboot.

  • You can only accept your own answers after 8 hours apparently. BTW, thanks for your input. Being more of a Ubuntu man, it was handy getting the actual commands to try as they were different to what I am used to. – MortimerCat Nov 24 '16 at 15:45

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.