2

In ntpd the kernel copies the system time to the hardware clock every 11 minutes.

However, if the system time and hardware clock are more than 30 minutes out of sync this copy does not happen and the system and hardware clock remain out of sync.

Is there any way to have 11-minute mode work if the system and hardware clock are more than 30 minutes out of sync, or is there any other tool to use to automatically sync the system and hardware clock?

1 Answer 1

5

To sync NTP that is out of the clock for more than the panic threshold e.g. if the time is substantially off, you either call ntpd with the -g option:

-g Normally, ntpd exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, ntpd will exit with a message to the system log. This option can be used with the -q and -x options.

And you put in /etc/ntp.conf:

tinker panic 0

By default, the NTP daemon sometimes panics and exits if the underlying clock appears to be behaving erratically. This option causes the daemon to keep running instead of panicking.

tinker panic 0 is specially useful for VMs, whether recovering a snapshot, or a VM with a misbehaving clock.

As a pertinent note, tinker panic 0 should be the first line of the configuration file.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.