8

Recently I have kickstarted some servers that had their time off by a month in the bios. The time in the bios said it was a random time/date in May, while it was June.

This caused NTP not to work, because NTP doesn't sync with such a high offset. How can I make sure that NTP syncs despite the offset, in this case a month, being too high?

ujjain
  • 3,983
  • 16
  • 53
  • 91

3 Answers3

5

See -g option for ntpd; set in /etc/sysconfig/ntpd. (IMO, running both ntpd and ntpdate is distasteful.)

Stefan Paletta
  • 231
  • 1
  • 3
  • On CentOS 6, I believe /etc/sysconfig/ntpd defaults to: OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid -g" – tgharold Sep 28 '13 at 03:51
  • 1
    For this to work for me I had to use the following steps 'sudo service ntp stop' 'ntpq -gq' and 'sudo service ntp start' – Terry Horner Feb 09 '18 at 13:54
1

For EL5 and EL6:

Start ntpdate as well.

It should be sufficient to enable them in your kickstart.

%post
chkconfig ntpdate on
chkconfig ntpd on
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
1

Running the following from the command line should force an update despite any time difference.

ntpd -gq
Thomas Bratt
  • 355
  • 2
  • 6
  • 16