Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3002 - NTPD launching script can't start #8018

Closed
openwrt-bot opened this issue Apr 13, 2020 · 3 comments
Closed

FS#3002 - NTPD launching script can't start #8018

openwrt-bot opened this issue Apr 13, 2020 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

newic:

hello all,

I can launch NTP by :

/usr/sbin/ntpd -n -N -l -S /usr/sbin/ntpd-hotplug 0.openwrt.pool.ntp.org ntp.lothaire.net ntp.ciril.fr 1.fr.pool.ntp.org debian.org
When i use Luci web client and use it to configure ntp the result is :

/usr/sbin/ntpd -n -N -l -S -p /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p ntp.lothaire.net -p ntp.ciril.fr -p 1.fr.pool.ntp.org debian.org

and so it doesn't start.

In my init script /etc/init.d/sysntpd I changed the line 55 by :

procd_append_param command $peer
(removed -p)

and look like it's work perfectly.

@openwrt-bot
Copy link
Author

rfrankla:

I tested this using OpenWrt 19.07.3 built from source,
and I expect it to be just the same in earlier versions.

First I entered the server names through LuCI, restarted sysntpd and checked the process...
# ps ww | grep ntp
27406 root 1072 S< /usr/sbin/ntpd -n -N -l -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p ntp.lothaire.net -p ntp.ciril.fr -p 1.fr.pool.ntp.org -p debian.org
27464 root 1072 R grep ntp

Almost the same as reported, except I also set as an NTP server (-l option) and a -p for the final debian.org.

Stopped the sysntpd init process, so I can test at the terminal.
Also, set the 'initscript' variable so the hotplug scripts don't complain,
and clear /tmp/state/dnsmasqsec so I can see the "stratum" message when the first good server response is accepted,
and -d -d -d to see the debug output.
# rm /tmp/state/dnsmasqsec

initscript=ntpd /usr/sbin/ntpd -n -N -l -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p ntp.lothaire.net -p ntp.ciril.fr -p

1.fr.pool.ntp.org -p debian.org
ntpd: '0.openwrt.pool.ntp.org' is 85.199.214.102
ntpd: 'ntp.lothaire.net' is 193.50.27.66
ntpd: 'ntp.ciril.fr' is 193.50.27.66
ntpd: duplicate peer ntp.ciril.fr (193.50.27.66)
ntpd: '1.fr.pool.ntp.org' is 151.80.124.104
ntpd: 'debian.org' is 130.89.148.77
ntpd: sending query to 130.89.148.77
ntpd: sending query to 151.80.124.104
ntpd: sending query to 193.50.27.66
ntpd: sending query to 85.199.214.102
ntpd: reply from 151.80.124.104: offset:-0.000200 delay:0.029346 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x01
ntpd: no valid datapoints, no peer selected
ntpd: reply from 85.199.214.102: offset:-0.000963 delay:0.034248 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x01
ntpd: no valid datapoints, no peer selected
ntpd: reply from 130.89.148.77: offset:-0.003252 delay:0.034376 status:0x24 strat:3 refid:0x418b657e rootdelay:0.026322 reach:0x01
ntpd: no valid datapoints, no peer selected
ntpd: reply from 193.50.27.66: offset:+0.000429 delay:0.039100 status:0x24 strat:2 refid:0x8b1b32c1 rootdelay:0.000916 reach:0x01
ntpd: no valid datapoints, no peer selected
ntpd: poll:1s sockets:1 interval:1s
ntpd: sending query to 130.89.148.77
ntpd: sending query to 151.80.124.104
ntpd: sending query to 193.50.27.66
ntpd: reply from 151.80.124.104: offset:-0.000333 delay:0.029428 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x03
ntpd: reply from 130.89.148.77: offset:-0.003652 delay:0.035183 status:0x24 strat:3 refid:0x418b657e rootdelay:0.026322 reach:0x03
ntpd: update from 151.80.124.104: same or older datapoint, not using it
ntpd: sending query to 130.89.148.77
ntpd: sending query to 85.199.214.102
ntpd: reply from 85.199.214.102: offset:-0.000102 delay:0.026828 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x03
ntpd: executing '/usr/sbin/ntpd-hotplug stratum'
ntpd: update from:85.199.214.102 offset:-0.000102 delay:0.026828 jitter:0.002000 clock drift:+8.439ppm tc:4
ntpd: reply from 130.89.148.77: offset:-0.003760 delay:0.033973 status:0x24 strat:3 refid:0x418b657e rootdelay:0.026322 reach:0x07
ntpd: update from 85.199.214.102: same or older datapoint, not using it
ntpd: sending query to 130.89.148.77
ntpd: sending query to 151.80.124.104
ntpd: reply from 151.80.124.104: offset:-0.000932 delay:0.029517 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x07
ntpd: update from 85.199.214.102: same or older datapoint, not using it
ntpd: sending query to 85.199.214.102
ntpd: reply from 85.199.214.102: offset:+0.001212 delay:0.030979 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x07
ntpd: update from:85.199.214.102 offset:+0.001212 delay:0.030979 jitter:0.002000 clock drift:+8.439ppm tc:4
ntpd: sending query to 151.80.124.104
ntpd: sending query to 85.199.214.102
ntpd: reply from 151.80.124.104: offset:-0.002639 delay:0.032459 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x0f
ntpd: update from 85.199.214.102: same or older datapoint, not using it
ntpd: reply from 85.199.214.102: offset:-0.002302 delay:0.032505 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x0f
ntpd: update from:85.199.214.102 offset:-0.002302 delay:0.032505 jitter:0.002463 clock drift:+8.439ppm tc:4
ntpd: sending query to 85.199.214.102
ntpd: reply from 85.199.214.102: offset:-0.000796 delay:0.028296 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x1f
ntpd: update from:85.199.214.102 offset:-0.000796 delay:0.028296 jitter:0.002261 clock drift:+8.439ppm tc:4
ntpd: sending query to 151.80.124.104
ntpd: reply from 151.80.124.104: offset:-0.001184 delay:0.029117 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x1f
ntpd: update from 85.199.214.102: same or older datapoint, not using it
ntpd: sending query to 85.199.214.102
ntpd: reply from 85.199.214.102: offset:-0.001433 delay:0.032032 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x3f
ntpd: update from:85.199.214.102 offset:-0.001433 delay:0.032032 jitter:0.002000 clock drift:+8.439ppm tc:4
ntpd: sending query to 151.80.124.104
ntpd: reply from 151.80.124.104: offset:-0.001189 delay:0.028078 status:0x24 strat:2 refid:0xf5054b9e rootdelay:0.027543 reach:0x3f
ntpd: update from 85.199.214.102: same or older datapoint, not using it
ntpd: sending query to 85.199.214.102
ntpd: reply from 85.199.214.102: offset:-0.000957 delay:0.026268 status:0x24 strat:1 refid:0x00535047 rootdelay:0.000000 reach:0x7f
ntpd: update from:85.199.214.102 offset:-0.000957 delay:0.026268 jitter:0.002000 clock drift:+8.439ppm tc:4

...etc...

All looks OK, except for duplicate peer ntp.ciril.fr (193.50.27.66)
# dig ntp.lothaire.net

; <<>> DiG 9.14.8 <<>> ntp.lothaire.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31809
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 3, ADDITIONAL: 4

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ntp.lothaire.net. IN A

;; ANSWER SECTION:
ntp.lothaire.net. 25200 IN CNAME ntp.ciril.fr.
ntp.ciril.fr. 25200 IN CNAME arcturus.ciril.fr.
arcturus.ciril.fr. 25133 IN A 193.50.27.66

;; AUTHORITY SECTION:
ciril.fr. 25133 IN NS orion.ciril.fr.
ciril.fr. 25133 IN NS arcturus.ciril.fr.
ciril.fr. 25133 IN NS ns2.nic.fr.

;; ADDITIONAL SECTION:
orion.ciril.fr. 25133 IN A 193.50.27.67
orion.ciril.fr. 25133 IN AAAA 2001:660:4503:201::67
arcturus.ciril.fr. 25133 IN AAAA 2001:660:4503:201::66

;; Query time: 83 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Jun 20 09:32:09 BST 2020
;; MSG SIZE rcvd: 238

then in another terminal.

ntpd -n -w -p 127.0.0.1

ntpd: reply from 127.0.0.1: offset:+0.000014 delay:0.000121 status:0x24 strat:2 refid:0x00535047 rootdelay:0.026261 reach:0x01
ntpd: reply from 127.0.0.1: offset:+0.000005 delay:0.000091 status:0x24 strat:2 refid:0x00535047 rootdelay:0.026261 reach:0x03
ntpd: reply from 127.0.0.1: offset:+0.000003 delay:0.000086 status:0x24 strat:2 refid:0x00535047 rootdelay:0.026261 reach:0x07

(Note: the refid matches the earlier 85.199.214.102)

So, looks like it is working correctly.

Furthermore. Running with all the -p options removed gives NO DEBUG OUTPUT...

initscript=ntpd /usr/sbin/ntpd -d -d -d -n -N -l -S /usr/sbin/ntpd-hotplug 0.openwrt.pool.ntp.org ntp.lothaire.net ntp.ciril.fr

1.fr.pool.ntp.org debian.org

This is the same as....

initscript=ntpd /usr/sbin/ntpd -d -d -d -n -N -l -S /usr/sbin/ntpd-hotplug

then in another terminal.

ntpd -n -w -p 127.0.0.1

ntpd: reply from 127.0.0.1: offset:+0.000005 delay:0.000145 status:0x24 strat:1 refid:0x00000000 rootdelay:0.000000 reach:0x01
ntpd: reply from 127.0.0.1: offset:-0.000005 delay:0.000103 status:0x24 strat:1 refid:0x00000000 rootdelay:0.000000 reach:0x03
ntpd: reply from 127.0.0.1: offset:-0.000054 delay:0.000194 status:0x24 strat:1 refid:0x00000000 rootdelay:0.000000 reach:0x07

The NTP server is acting as its own independent clock source (stratum:1)
This is as the code is designed -- all working as expected.

@openwrt-bot
Copy link
Author

rfrankla:

I'm going to recommend closing this, and the other two duplicates, with no problem found.

@openwrt-bot
Copy link
Author

bjonglez:

Thanks for digging into that.

I'm also seeing no issue with either 18.06 or 19.07, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant