1

I have an Oracle Linux 6 box (RHEL) and I have set up ntpd. I have run service ntpd start and chkconfig on. Now, if my date is incorrect and I reboot the box, it sets the time and date properly. That said, if the box is running, and I change the date using date --set "SEP 01 2000 00:00:00", it doesn't seem to update the time unless I reboot the box, or run service ntpd restart.

Am I doing something wrong? Is it working properly? My belief of how it should work is that if I change the date on the box, it should change it back within a reasonable amount of time.

Alexis Wilke
  • 2,857

2 Answers2

4

If you change the clock underneath NTP while it's running, it will either start to slew the clock back - if it's not too far out - or simply give up in disgust and exit.

If you do change the clock a little, so that NTP remains running, it will assume that the change is due to a faulty clock, and will start to apply the correction longer term too, in an attempt to maintain correct time even when the network is disconnected. In an extreme case you can get worse clock drift over a longer period. At this point you need to remove the time adjustment files and reboot at least twice. (Not a happy situation.)

Bottom line: don't change the clock if you're using NTP.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
  • Thanks, this gives a nice detailed description to my issue. I was actually hoping that ntpd would solve all issues with time changes, but it doesn't. Either way, I tested it with an 8 minute difference and within 30 minutes it synced back to an accurate time. Thanks again – jonesy19 Jan 17 '19 at 19:58
  • @jonesy19 don't change the clock while NTP is running. Even for testing. Other than that, what other issues have you still got outstanding? – Chris Davies Jan 17 '19 at 20:28
  • Thanks, yeah I have realized it doesn't like the manual change. As for other issues, there are plenty, but none related to this. Thanks for the help. ;) – jonesy19 Jan 18 '19 at 21:21
2

Possible duplicate of this

ntpd will not try resetting the clock if it is too far out of sync.

doneal24
  • 5,059