7

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?

5

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

2
  • 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 3:51
  • 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 9 '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
1

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

ntpd -gq

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.