Article 6NQKR Slackware 15.0 ntpd appears to start ntpq gives connection refused on arguements

Slackware 15.0 ntpd appears to start ntpq gives connection refused on arguements

by
rocknrobin
from LinuxQuestions.org on (#6NQKR)
Hell-o again. I thought I had my ntp issues resolved on my last thread:

https://www.linuxquestions.org/quest...ot-4175737929/

As further background I actually maintain four of these Slackware 15.0 distros and when I did updates on them yesterday all but one of them appeared to have ntp working correctly after reboot. Where I noticed the problem was trying to check ntpq -p

Code:
The one that doesn't work
root@robrutrm:/var/lib/ntp/stats# ntpq -p
ntpq: read: Connection refused

One that does work
root@robrutrm:/etc# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
LOCAL(0) .LOCL. 10 l 11h 64 0 0.000 +0.000 0.000
-coco.presumed.n 208.113.130.146 3 u 406 1024 377 52.765 -5.314 9.023
+148.135.68.31 ( 173.11.101.155 2 u 184 1024 377 46.006 -1.788 4.829
*dns-e.ns4v.icu 141.32.131.246 2 u 56 1024 377 36.258 +2.917 3.530
+157.245.125.229 130.207.244.240 2 u 259 1024 367 58.800 -4.131 7.714I ran other tests:

Code:
The one where ntpq doesn't work
root@robrutrm:/var/lib/ntp/stats# ps -ef | grep ntp
ntp 3927 1 0 04:40 ? 00:00:02 /usr/sbin/ntpd -g -4 -p /run/ntpd.pid -u ntp:ntp
root 13227 1844 0 16:01 pts/2 00:00:00 grep ntp

root@robrutrm:/var/lib/ntp/stats# cat /var/log/ntp.log (Note...the log rotated this morning)
23 Jun 04:40:10 ntpd[3927]: initial drift restored to 14.245682
23 Jun 04:40:10 ntpd[3927]: Listen and drop on 0 v4wildcard 0.0.0.0:123
23 Jun 04:40:10 ntpd[3927]: Listen normally on 1 lo 127.0.0.1:123
23 Jun 04:40:10 ntpd[3927]: Listen normally on 2 eth0 10.160.134.69:123
23 Jun 04:40:10 ntpd[3927]: Listen normally on 3 eth1 10.160.160.20:123
23 Jun 04:40:10 ntpd[3927]: Listening on routing socket on fd #20 for interface updates
23 Jun 04:40:10 ntpd[3927]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized
23 Jun 04:40:10 ntpd[3927]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized

The one that where ntpq does work
root@robrutrm:/etc# ps -ef | grep ntp
ntp 10687 1 0 04:40 ? 00:00:01 /usr/sbin/ntpd -g -4 -p /run/ntpd.pid -u ntp:ntp
root 13414 2618 0 16:01 pts/4 00:00:00 grep ntp

root@robrutrm:/home/robby/pug/data# cat /var/log/ntp.log
23 Jun 04:40:03 ntpd[10687]: initial drift restored to 42.967010
23 Jun 04:40:03 ntpd[10687]: Listen and drop on 0 v4wildcard 0.0.0.0:123
23 Jun 04:40:03 ntpd[10687]: Listen normally on 1 lo 127.0.0.1:123
23 Jun 04:40:03 ntpd[10687]: Listen normally on 2 eth0 10.160.134.60:123
23 Jun 04:40:03 ntpd[10687]: Listen normally on 3 eth1 10.160.160.10:123
23 Jun 04:40:03 ntpd[10687]: Listening on routing socket on fd #20 for interface updates
23 Jun 04:40:03 ntpd[10687]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized
23 Jun 04:40:03 ntpd[10687]: kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized
I then checked the drift file and loopstats file on the box that wasn't working:

Code:
Both files appeared to have been written to recently
root@robrutrm:/var/lib/ntp# ls -l
total 8
-rw-r--r-- 1 ntp ntp 10 Jun 23 14:40 drift
drwxr-xr-x 2 ntp ntp 4096 Jun 23 04:40 stats/

The drift file has an entry in it
root@robrutrm:/var/lib/ntp# cat drift
14.301117

The stats file is full of data

root@robrutrm:/var/lib/ntp/stats# cat loopstats
60484 77.900 0.025152606 14.525 0.008892789 0.000000 6
60484 81.898 0.023026155 14.525 0.008352348 0.000000 6
60484 139.915 0.015904966 14.525 0.008208557 0.000000 6
60484 141.950 0.005229029 14.525 0.008555981 0.000000 6
60484 206.899 -0.000331699 14.482 0.008241324 0.015213 6
60484 545.941 0.004687316 15.997 0.007910646 0.535962 6
60484 610.899 -0.003447055 15.783 0.007938956 0.507007 6
60484 747.898 -0.002691115 15.432 0.007431021 0.490283 6
60484 1288.899 -0.001058346 14.915 0.006975013 0.493672 6
60484 1488.899 -0.000288458 14.860 0.006530203 0.462197 7
60484 2426.936 0.000085176 14.879 0.006109874 0.432399 7
60484 2478.902 0.000387554 14.884 0.005716263 0.404475 7
60484 2612.898 0.000389274 14.896 0.005347075 0.378378 7
60484 3484.937 -0.000160323 14.863 0.005005503 0.354136 7
60484 3537.898 -0.000141793 14.861 0.004682224 0.331265 8
60484 5446.886 0.000467027 14.914 0.004385106 0.310439 8
60484 5894.886 0.000722328 14.934 0.004102884 0.290469 8
60484 6557.899 -0.001208908 14.886 0.003898161 0.272233 8
60484 7014.936 -0.000933022 14.860 0.003647700 0.254810 9
60484 7282.936 -0.000822487 14.857 0.003412335 0.238355 9
60484 7617.898 -0.000164191 14.856 0.003200421 0.222961 9
60484 8326.886 -0.000718090 14.849 0.003000118 0.208578 9
60484 9744.899 -0.001396631 14.819 0.002816589 0.195386 10
60484 10118.886 -0.001416652 14.817 0.002634687 0.182768 10
60484 10271.899 -0.000893144 14.817 0.002471464 0.170964 10
60484 12371.905 0.001010094 14.945 0.002407781 0.166217 10
60484 13424.900 0.000700729 14.948 0.002254927 0.155485 10
60484 14476.899 -0.000025939 14.947 0.002124880 0.145443 10
60484 16291.938 -0.000978806 14.941 0.002015991 0.136069 10
60484 17606.886 -0.001286485 14.935 0.001888922 0.127301 10
60484 17670.886 -0.001630082 14.934 0.001771096 0.119079 10
60484 18379.929 -0.002440133 14.928 0.001681281 0.111412 10
60484 19715.899 -0.002211471 14.917 0.001574771 0.104289 10
60484 21574.886 -0.002404345 14.900 0.001474641 0.097731 10
60484 21820.899 -0.001836708 14.898 0.001393923 0.091421 10
60484 23776.934 -0.001407748 14.888 0.001312686 0.085593 10
60484 25025.900 -0.002142238 14.878 0.001255064 0.080143 10
60484 26062.899 -0.004568048 14.861 0.001453911 0.075225 10
60484 27123.899 -0.004511639 14.843 0.001360155 0.070649 10
60484 29235.900 -0.004274510 14.303 0.001275068 0.201903 10
60484 30293.898 -0.005311184 14.282 0.001247762 0.189008 10
60484 31058.942 -0.005491210 14.267 0.001168909 0.176888 10
60484 32098.940 -0.005374178 14.246 0.001094196 0.165627 10
60484 33512.899 -0.002975128 14.230 0.001329300 0.155029 10
60484 34591.898 -0.003354083 14.217 0.001250644 0.145094 10
60484 34818.077 -0.001938442 14.246 0.000685343 0.000000 6
60484 34822.077 -0.002076764 14.246 0.000642942 0.000000 6
60484 34880.075 -0.001245350 14.246 0.000669410 0.000000 6
60484 34946.074 -0.000603405 14.246 0.000666038 0.000000 6
60484 34951.063 0.001138410 14.246 0.000876011 0.000000 6
60484 35020.065 0.001217880 14.246 0.000819915 0.000000 6
60484 35086.062 -0.001292457 14.246 0.001173010 0.000000 6
60484 35155.061 -0.000607636 14.046 0.001123646 0.070688 6
60484 35422.061 -0.000662827 13.877 0.001051256 0.089067 6
60484 35554.061 -0.000742451 13.784 0.000983763 0.089628 6
60484 36094.063 -0.000093836 13.738 0.000948369 0.085390 6
60484 36431.061 0.000110527 13.773 0.000890055 0.080857 6
60484 36973.061 0.000207560 13.875 0.000833277 0.083693 7
60484 37042.061 -0.000124536 13.873 0.000788253 0.078291 7
60484 37172.061 -0.000047583 13.871 0.000737845 0.073236 7
60484 38224.061 0.000015779 13.875 0.000690554 0.068520 7
60484 38353.061 0.000135911 13.879 0.000647349 0.064112 7
60484 38481.064 0.000098986 13.882 0.000605680 0.059980 8
60484 39412.063 -0.000071091 13.878 0.000569744 0.056124 8
60484 39558.074 -0.000225571 13.876 0.000535738 0.052504 8
60484 39683.061 -0.000281549 13.874 0.000501528 0.049118 8
60484 40466.061 -0.000163006 13.866 0.000471005 0.046024 9
60484 42838.064 -0.000260632 13.830 0.000441935 0.044963 9
60484 43323.015 -0.000310226 13.828 0.000413764 0.042066 9
60484 43353.061 -0.000193635 13.827 0.000389229 0.039350 9
60484 44853.075 -0.000266686 13.822 0.000365006 0.036869 10
60484 46408.076 0.000061103 13.822 0.000360564 0.034488 10
60484 46459.015 0.000057224 13.822 0.000337279 0.032260 10
60484 47028.062 0.000440378 13.823 0.000343349 0.030178 10
60484 48530.073 -0.000127724 13.822 0.000378808 0.028230 10
60484 50184.064 0.000303750 13.824 0.000385785 0.026415 10
60484 51259.015 0.000210848 13.825 0.000362360 0.024711 10
60484 52247.061 -0.000181696 13.824 0.000366269 0.023116 10
60484 52283.015 -0.000184565 13.824 0.000342615 0.021623 10
60484 53293.061 -0.000085654 13.824 0.000322389 0.020227 10
60484 55365.062 0.000277507 13.859 0.000327764 0.022731 10
60484 57021.074 -0.000486762 13.856 0.000408674 0.021289 10
60484 58521.061 0.001929602 13.867 0.000935944 0.020276 10
60484 60632.062 0.002742075 14.214 0.000921415 0.123895 10
60484 62404.076 0.002666840 14.231 0.000862315 0.116060 10
60484 62738.074 0.000399293 14.232 0.001137260 0.108565 10
60484 63769.071 -0.000615583 14.229 0.001122692 0.101556 10
60484 64520.073 0.001435673 14.233 0.001276260 0.095008 10
60484 64967.061 0.000107099 14.233 0.001282916 0.088872 10
60484 65927.061 0.002874744 14.244 0.001548426 0.083211 10
60484 67646.075 0.003023432 14.263 0.001449373 0.078138 10
60484 69076.072 0.004054335 14.285 0.001403903 0.073489 10
60484 70128.063 0.004198502 14.301 0.001314220 0.068988 10
60484 72240.073 -0.000381364 14.253 0.002033021 0.066739 10
60484 73295.064 0.003526815 14.267 0.002350694 0.062621 10
60484 74329.062 0.004266261 14.283 0.002214360 0.058864 10The clock appears to be synched. I ran these commands almost simultaneously, at least as close as possible and got pretty much the same times:

Code:
The one where ntpq doesn't work
root@robrutrm:/var/lib/ntp/stats# clock
2024-06-23 15:43:02.186883-05:00

The one where ntpq does work
root@robrutrm:/home/robby/pug/data# clock
2024-06-23 15:43:01.721074-05:00Therefore on the box where I can't get ntpq to work right it appears that it started ok, ps -ef, it logged the same entries on startup as the one where ntpq does work, the one that doesn't work is writing a drift file and loopstats files, and the time on that box where ntpq does not work seems to have the time synched.

Here is the etc/default/ntp file, just as on the other boxes where ntpq does work
Code:
root@robrutrm:/var/lib/ntp# cat /etc/default/ntp
# Default options for the ntpd daemon:
#
# -g: allow initial time correction to be Big (once only)
# -p /run/ntpd.pid: write ntpd PID to this location
# -u ntp:ntp: run ntpd as user ntp, group ntp
#
# Depending on your network, you might want to add -4 (ipv4 only)
# or -6 (ipv6 only).
#
# For other available options, see "man ntpd".

NTPD_OPTS="-g -4 -p /run/ntpd.pid -u ntp:ntp"In addition the ntp.conf file on the box where ntpq doesn't work is identical in size to the boxes where ntpq does work. Here it is

Code:
root@robrutrm:/var/lib/ntp# cat /etc/ntp.conf
# Sample /etc/ntp.conf: Configuration file for ntpd.

#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 10. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

#
# NTP server (list one or more) to synchronize with:
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst

#
# Full path of a directory where statistics files should be created
#
statsdir /var/lib/ntp/stats
statistics loopstats

#
# Location of an alternate log file to be used instead of the default system syslog(3) facility
#
# logfile /var/log/ntp
logfile /var/log/ntp.log

#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /var/lib/ntp/drift

#
# Location of PID file
#
pidfile /var/run/ntpd.pid

#
# Uncomment to use a multicast NTP server on the local subnet:
#multicastclient 224.0.1.1 # listen on default 224.0.1.1
# Set an optional compensation for broadcast packet delay:
#broadcastdelay 0.008

#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 640 owned by root:ntp) and define the key number to
# be used for making requests.
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will.
#
#keysdir /etc
#keys /etc/ntp.keys
#trustedkey 65535
#requestkey 65535
#controlkey 65535

#
# Don't serve time or stats to anyone else by default (more secure)
restrict default limited kod nomodify notrap nopeer noquery
restrict -6 default limited kod nomodify notrap nopeer noquery

#
# Use these lines instead if you do want to serve time and stats to
# other machines on the network:
#restrict default limited kod nomodify notrap nopeer
#restrict -6 default limited kod nomodify notrap nopeer

#
# Trust ourselves. :-)
restrict 127.0.0.1
restrict ::1Does anyone have a clue why ntpq would give me the connection refused on almost all paramaters?

Thanks ahead of time.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments