DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi folks,
I'm having a problem with ntpq on one of my raspberry pi's - both are running raspbian and are up to date.
It seems as if ntp is working fine on both of them as they are keeping good time.
On the (older) raspberry pi, the ntpq -c rv command returns:-
whereas on the later, model B plus, pi the same query returns:-
pi@PiBplus:~$ ntpq -c rv
localhost: timed out, nothing received
***Request timed out
They both have identical /etc/ntp.conf and /etc/hosts files (apart from differing names in the /etc/hosts file).
I want this ntpq query to work on both as I am using its output to plot their timekeeping performance with MRTG.
Is there some other file I should be checking to see where the difference/problem is?
Any help/advice would be very welcome - I've spent quite a long time googling this problem without any luck !
Thanks
nigelh
Their /etc/ntp.conf files contain :-
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
# on pibplus
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
You can probably get the one that works to serve time to the other.
Have you pinged the ntp servers from the non-functional R-pi?
What about resolv.conf?
Hi business kid,
thanks for your reply.
/etc/resolv.conf on both pi's is the same :-
nameserver 8.8.8.8
I can ping the ntp servers fine from both of them - this is from the one that ntpq is NOT working on:-
pi@PiBplus:~$ ping pool.ntp.org
PING pool.ntp.org (178.79.155.116) 56(84) bytes of data.
64 bytes from nice.stuff.is (178.79.155.116): icmp_req=1 ttl=55 time=74.9 ms
64 bytes from nice.stuff.is (178.79.155.116): icmp_req=2 ttl=55 time=72.4 ms
64 bytes from nice.stuff.is (178.79.155.116): icmp_req=3 ttl=55 time=81.5 ms
64 bytes from nice.stuff.is (178.79.155.116): icmp_req=4 ttl=55 time=98.4 ms
I'm getting virtually the same result from the original one that ntpq IS working on
I am pretty sure that ntp is working OK on both - they are both showing exactly the same time when I use the date command
The problem is that "ntpq -c rv" is failing on the newer, model B+ raspberry pi.
Most odd!
Thanks anyway
Nigel
It looks good.I have been caught out with ld-linux.so aka ld-2.xx.so, aka ld-lsb.so because the ldd finds it but the program (ge in particular) does not. But it looks good
I have both a PiB and a PiB+. They both work fine with ntp
I just did a ntpq -c rl and precision was reported as "-20" [0.000000954 s]. Good enough for me.
The PiB+ is my LAN ntp server ( at one time it was getting the time from a USB GPS dongle, but then I re-purposed the GPS dongle, as it didn't seem to be that accurate without the 1PPS signal it could not provide )
Hi tredegar,
thanks for your reply.
No, I'm not running any firewalls.
On the PiB+ I can ping the time servers OK as well as localhost ((after adding "auto lo" to /etc/network/interfaces !) but still can't get ntpq -c rv to work.
I'll have a good read of the link you've sent - thanks for that.
A network problem does seem a possibility.
Good to hear that it is working, for you, on a PiB+ - at one stage I was wondering if it was B+ problem!
Hi folks,
quite by chance, I've solved the problem !
Because of a power cut, the raspberry pi B plus with the ntpq problem was powered off and back on about 15 minutes later and, bingo, the ntpq -c rv command worked and I can ping localhost!
Up to then I had been doing a soft reboot - seems like it needed a complete reset !
Thanks for all your help
Nigel
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.