Red Hat Bugzilla – Bug 1478074
Fedora 26 upgrade breaks ntp pps
Last modified: 2018-02-27 05:28:23 EST
Description of problem:
After upgrading to Fedora 26 fro 24 I noticed that ntpd no longer 'sees' my Garmin GPS18LVC GPS freceiver nor any external ntp servers as shown in `ntpq -pn`.
Version-Release number of selected component (if applicable):
# rpm -q ntp
error: bad option 'ptflags' at (null):19
Yes, notice the additional error that was not there while running Fedora 24.
Have working Fedora 24 ntp setup with gps receiver using PPSapi like Garmin GPS18LVC
Upgrade to Fedora 26 using dnf.
After upgrade check the gps using ntpq -pn (etc)
All clocks gone.
No clocks lost.
In /var/log/messages we find:
Aug 3 16:10:04 epia ntpd: GPS_NMEA(0) set PPSAPI params fails
Aug 3 16:10:04 epia ntpd: giving up resolving host surfplank2: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host ntp.xs4all.nl: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host ntp2.xs4all.nl: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host ntp0.nl.net: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host ntp2.nl.net: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host keetweej.vanheusden.com: Servname not supported for ai_socktype (-8)
Aug 3 16:10:04 epia ntpd: giving up resolving host ntp.nmi.nl: Servname not supported for ai_socktype (-8)
Do you set flag3 to 1 for the NMEA refclock? The Fedora kernel doesn't support PPS kernel discipline and older ntp versions silently ignored the error.
# grep ^ntp /etc/services
ntp 123/udp # Network Time Protocol
# grep ^services nsswitch.conf
Kernel 4.9.40 has:
# grep PPS .config
# PPS support
# CONFIG_PPS_DEBUG is not set
# PPS clients support
# CONFIG_PPS_CLIENT_PARPORT is not set
# CONFIG_PPS_CLIENT_GPIO is not set
# PPS generators support
Just like previous kernels that worked wonders.
I use my own kernel.
And now two things break.
And network clocks.
I did not change anything in ntp.conf for ages:
# grep -v ^# ntp.conf
server 127.127.20.0 minpoll 4
fudge 127.127.20.0 flag3 1 flag2 0 flag1 1 time1 0.00000006 time2 0.160
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
logconfig -syncstatus -sysevents
discard average 5 minimum 2
restrict 127.127.0.0 mask 255.255.0.0 nopeer # internal clocks
restrict 127.0.0.1 mask 255.255.255.255 # accept local network
restrict ::1 # accept local network
restrict 192.168.10.0 mask 255.255.255.0 nomodify notrap nopeer # notrust
filegen peerstats file peers type day link disable
filegen loopstats file loops type day enable
When ntpd does not run in chroot things appear OK.
When in chroot the symptoms as described happen.
So the issue has to do with chroot.
strace did not yet yield any clues.
In chroot /dev/log is no longer found although /dev/log is present:
# ls -l /dev/log
srw-rw-rw- 1 root root 0 Aug 3 15:39 /dev/log
# ls -l /chroot/ntpd/dev/log
srw-rw-rw- 1 root root 0 Aug 3 15:39 /chroot/ntpd/dev/log
Yet we see:
Aug 3 16:34:36 epia ntpd: Cannot open logfile /dev/log: No such device or address
And perhaps we can explain these:
Aug 3 16:34:36 epia ntpd: refclock_params: time_pps_kcbind: Operation not supported
Aug 3 16:34:36 epia ntpd: GPS_NMEA(0) set PPSAPI params fails
by the GPS serial ports not being found in the chroot /dev but in the system /dev.
This has worked for years but is now broken.
Your kernel config is missing CONFIG_NTP_PPS. Please recompile the kernel with that option enabled (you will need to disable NO_HZ) or remove "flag3 1" from ntp.conf.
As for the chroot, does it include the /etc/service file?
Kernel 4.9.40 .config does not have CONFIG_NTP_PPS.
Having services and nsswitch.conf in /chroot/ntp/etc does not have any impact, behaviour does not change:
# ls -l /chroot/ntpd/etc/
-rw-r--r-- 2 root root 1834 Aug 3 16:18 nsswitch.conf
drwxrwx---. 2 root ntp 4096 Oct 24 2004 ntp
-rw-r-----. 2 root ntp 3315 Jun 8 2015 ntp.conf
-rw-r--r-- 2 root root 687295 Dec 7 2016 services
When not running in chroot, ntpq -pn reports all local and remote clocks.
# /usr/sbin/ntpdc -c loopinfo
localhost.localdomain: timed out, nothing received
***Request timed out
This worked before the upgrade.
Have you tried "strace -ff ntpd -d -u ntp |& grep open" to see what files it is missing?
ntpdc doesn't work in default configuration. The protocol is disabled by default as it allows very large traffic amplification. It can be enabled by adding "enable mode7" to ntp.conf.
enable mode7 added, thanks.
the strace reveals that, besides some libs that are not on my system anyways, only /dev/log is not found.
Yet /dev/log and /chroot/ntpd/dev/log both exist.
If I understand it correctly, all issues mentioned here were either resolved by updating the ntp configuration or need to be addressed outside ntp (kernel configuration, chroot setup). I'm closing the bug.