ntpd default config misses "iburst" / takes minutes to synchronize initially

Bug #538840 reported by Daniel Hahler
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ntp (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: ntp

My hardware clock is currently off during boot always (probably because of empty CMOS battery) and ntp takes some minutes before it synchronizes the clock.

ntp should synchronize/fix the clock right after it has been started (as fast as possible).

E.g. boot time is 03:39:01, ntpd start at 03:39:22 and time gets fixed after 03:42:53 - that's more than 3 minutes after ntpd has started.

Ubuntu Lucid, ntp 1:4.2.4p8+dfsg-1ubuntu1

Daniel Hahler (blueyed)
summary: - ntpd should update time faster after boot
+ ntpd should update time faster during boot
Daniel Hahler (blueyed)
summary: - ntpd should update time faster during boot
+ ntpd should synchronize time faster/earlier during boot
Chuck Short (zulcss)
Changed in ntp (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
David Sugar (dyfet-deactivatedaccount) wrote : Re: ntpd should synchronize time faster/earlier during boot

I believe this could be solved with 604717, which proposes and has a patch migrating ntpd to use upstart.

Revision history for this message
Daniel Hahler (blueyed) wrote :

No, I don't think that would help: ntpd gets started quite early already, but it takes up to some minutes after logging into KDE before the time gets fixed.

Therefore, I think it would require ntpd to be more aggressive with fixing the time initially.

Changed in ntp (Ubuntu):
status: Confirmed → Triaged
summary: - ntpd should synchronize time faster/earlier during boot
+ ntpd should synchronize time faster/earlier during/after boot
Revision history for this message
Daniel Hahler (blueyed) wrote : Re: ntpd should synchronize time faster/earlier during/after boot

This is caused by a missing "iburst" keyword with the "server" lines.

Ubuntu:
server ntp.ubuntu.com

Debian:
server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

I had myself the following, without the iburst (which I've now added):
server 0.de.pool.ntp.org iburst
server 1.de.pool.ntp.org iburst
server 2.de.pool.ntp.org iburst

summary: - ntpd should synchronize time faster/earlier during/after boot
+ ntpd default config misses "iburst" / takes minutes to synchronize
+ initially
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I know it's a long time, but I'm cleaning up old NTP bugs atm.

This has multiple "fixes" and things to bementioned.
First of all it is interesting that iburst "fixes" this as it is documented as:
When the server is unreachable, send a burst of eight packets instead of the usual one. The packet spacing is normally 2 s; however, the spacing between the first and second packets can be changed with the calldelay command to allow additional time for a modem or ISDN call to complete. This option is valid with only the server command and is a recommended option with this command.

While I don't see how this helps with the "problem" it is recommended so it should be fine to add.
We already did add it in the past by one of the merges with Debian, so recent releases already have the iburst as default.

Then to close one more extra info - ntp is meant to slowly drift times, as many logics hat to be time warped.
That said the issue of one (and only one) huge initial time warp is a known thing.
The solution to that is -g to ntpd which we use by default.
Documented as:
       -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.

That means if your offset is what ntp considers huge (>1000 sec) it warps time once, and if it is small it drifts towards it.

Also by default time is managed by systemd now, but still all old reported issues were fixed, juts people forgot to update - setting fix released.

Changed in ntp (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.