Opened 10 years ago

Closed 10 years ago

#900 closed defect (fixed)

openntpd: clock adjustment fails when ntp servers are not available at boot

Reported by: ben-keyword-openwrt.85f0dd@… Owned by: developers
Priority: normal Milestone:
Component: packages Version:
Keywords: openntpd Cc:


When ntpd is kicked off from the /etc/init.d/S55ntpd script, it's run with the -s option to immediately set the time, which is good.

However, if no NTP servers are available when ntpd is started (e.g. just booted and the Internet link is not yet up), ntpd will not be able to set the time; when the ntp servers do become available ntpd will try to use the kernel adjtime call to slew the clock into line, this is impractical (it would take forever to catch up from the boot-time of 2000-01-01), and doesn't work: adjtime doesn't allow such large adjustments (e.g. /usr/sbin/ntpd[617]: adjusting local clock by 215648283.905616s followed by adjtime failed: Invalid argument).

The simple (only?) solution is to kick ntp whenever the network state changes

# cat /etc/hotplug.d/iface/55-ntpd 
# hopefully some ntp servers are reachable now...
killall ntpd
/etc/init.d/S55ntpd start

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Should be fixed with [5420]

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.