I have an embedded Linux system without RTC, so it (currently) boots with thinking it's Jan, 1st 1970.
ntpd installed and started as:
with a pretty standard
server 0.pool.ntp.org iburst server 1.pool.ntp.org iburst server 2.pool.ntp.org iburst server 3.pool.ntp.org iburst restrict default nomodify nopeer noquery limited kod restrict 127.0.0.1 restrict [::1]
Unfortunately this takes a looong time (sometimes >120s) to achieve lock (i.e.: a peer flagged with
ntpq -nc peers).
What further options (if any) could I use to shorten as much as possible sync time?
Related question: what is a reasonable sync time (assuming a reasonable network connection with ~16ms
ping time to
Note: I did read
man 8 ntpd and
man 5 ntp.conf, but I'm pretty confused and I would like expert advice.
Given the comments I think I need to elaborate my use-case:
- My embedded Linux system does not have a RTC, so it wakes up at Jan 1st 1970.
- I start
ntpdfrom sysV initialization scripts as
start-stop-daemon -S -q -x /usr/sbin/ntpd -- -g
- I need to know when system time is "reasonably close" (I can accept error of several seconds, not in the "minutes" range).
- Network may be either wired or WiFi (or both), so it may take a substantial amount of time for it to get up.
- Even when LAN is up-and-running I may have problems accessing Time Servers due to connectivity, NAT or firewalling; this means waiting a fixed amount of time won't work (even if I can
- I can have "correct" time by means different from
ntp(e.g.: user explicitly sets date&time, possibly with huge error!).
My aim is to get info, as soon as possible, if current time was retrieved from
ntp server (so it can be "trusted") or not. As said I do not need sub-second precision, but I need to know "for sure" if and when minute is correct, as soon as possible, assuming net is working, of course).