Hello,
I’ve been chasing down an issue with running the NTP server on my Turris Omnia (TOS 6). I believe I found a source of confusion across the forum base and hope I could get some folks to validate my findings.
Steps to reproduce:
-
Enabled the NTP Server in LuCI → System → System → Time Syncronization. Save & Apply.
-
Via SSH/Console, check if it is running with
netstat -a -n -l |grep 123
- See what is running under with the name ntp:
ps aux -w |grep ntp
root 4179 0.0 0.0 744 36 ? S 13:48 0:00 /usr/sbin/ntpclient -i 600 -s -l -D -p 123 -h 0.openwrt.pool.ntp.org
I believe this is the problem! ntpclient is explictly being bound to port 123 vs. using any available port. This prevents the sysntpd daemon from starting.
For extra measure, I gave it ye old reboot and see what the logs tells me:
Jan 27 18:48:42 turris root: starting ntpclient
Jan 27 18:48:57 turris procd: Instance sysntpd::instance1 s in a crash loop 6 crashes, 0 seconds since last crash
Not the most verbose logs in terms of what, exactly, is happening but indiciative.
Continuing to poke…
If I stop the ntpclient with: killall -9 ntpclient
And then manually start the sysntpd with: /etc/init.d/sysntpd restart
I can verify the server is running with netstat:
netstat -a -n -l |grep 123
udp 0 0 :::123 :::*
And once again with ps aux -w |grep ntp
root 7245 0.0 0.0 1232 548 ? S< 14:10 0:00 /usr/sbin/ntpd -n -N -l -I br-lan.1 -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.ntp.org -p 3.openwrt.pool.ntp.org
SO…I think ntpclient hard coding port 123 is creating a conflict with starting the ntp daemon/server. This hard coding is observed in /etc/hotplug.d/iface/20-ntpclient and has been around for 10 years according to gitlab entries…
Potential Solutions:
- Introduce logic to have the ntpclient bind to a different port if the server is enabled.
- Stop binding explictly to the port all together. The manpage for ntpclient says if you don’t specify, it will use any port available
Can anyone else confirm this behavior? Do I need to open a issue in gitlab?