Sysntpd stratum delay

OpenWrt 23.05.5 r24106-10cc5fcd00
Ubiquiti EdgeRouter X

When my system boots up there is a 1 minute delay from when the sysntpd service starts and the '/etc/hotplud.d/ntp/25-dnsmasqsec' script shows ACTION to be 'stratum' .

The ntp servers are listed by ip not name in /etc/config/system

config timeserver 'ntp'
option enable_server '1'
option use_dhcp '0'
list server '162.159.200.1'
list server '198.71.50.75'
list server '23.150.40.242'
list server '64.79.100.196'

I've tried different ntp servers and it makes no difference .

Asking this question because I have to wait until 'stratum' is achieved to start my wireguard devices .

I don't think you can control the behavior of the busybox ntpd daemon, but you can force the date/time update as soon as the wan interface goes up.

cat << "EOF" > /etc/hotplug.d/iface/15-ntpd
if [ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ]; then
ntpd -q -p 162.159.200.1 -p 198.71.50.75 -p 23.150.40.242
sleep 2
logger -t ntpd "System time synchronized at $(date)"
fi
EOF
2 Likes

But that wont trigger the ntp 'hotplug' will it ? The ntp 'hotplug' mechanism is how I know its OK to up the wireguard interface(s)

The ntp hotplug event will be registered as usual (a little later), but you can enable the wireguard interface(s) as soon as the time is synchronized, so you can even add a few lines to this script.

1 Like

OK I'll give that a try

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.