1

Usually ntpd will refuse to change (or slew) system time if difference is too large.

Is there some way (possibly via ntpq) to tell ntpd: "jump to whatever time you think is right"?

Specifically it should be a "jump if synchronized" action.

I would like to avoid, if possible killall -HUP ntpd && ntpd -g or equivalent commands

  • Have a look at ntpdate. – JRFerguson Oct 6 '18 at 15:26
  • You also might want to have a look at the iburst and burst otpions for ntpd. – Thomas Oct 6 '18 at 15:42
  • 2
    @JRFerguson: AFAIK ntpdate is currently deprecated; anyways it will not work with a running ntpd, so calling it would involve stopping ntpd anyways. – ZioByte Oct 6 '18 at 17:40
  • @Thomas: Thanks Tomas, but I already have iburst in my config... and it would mean restarting ntpd. I am starting to suspect restarting the daemon is the only solution. – ZioByte Oct 6 '18 at 17:45
2

Consider using sntp:

sudo sntp -s time.nist.gov

For a full list of the NIST time-server IP addresses, see https://tf.nist.gov/tf-cgi/servers.cgi.

0

You can use the -g flag on startup of the daemon.

From the man page for ntpd,

-g Normally, ntpd exits if the offset exceeds the sanity limit, which is 1000s by default. [...] This option overrides the limit and allows the time to be set to any value without restriction; however, this can happen only once. After that, ntpd will exit if the limit is exceeded.

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.