You are not logged in.

#1 2015-04-09 12:41:07

knue
Member
Registered: 2011-10-11
Posts: 27

ntpd -q hangs

Hi all,

I'm currently having problems configuring my time correctly. According to https://wiki.archlinux.org/index.php/Ne … col_daemon:

The ntp package provides a default configuration file that should make ntpd work out of the box in client mode, without requiring custom configuration.

I've never touched any of ntp's config files, so I would assume that

ntpd -q

would just work. However, this is not the case:

ntpd -qd
 9 Apr 15:43:43 ntpd[4399]: ntpd 4.2.8p1@1.3265-o Fri Feb  6 17:14:44 UTC 2015 (1): Starting
 9 Apr 15:43:43 ntpd[4399]: Command line: ntpd -qd
 9 Apr 15:43:43 ntpd[4399]: proto: precision = 0.105 usec (-23)
Finished Parsing!!
move_fd: estimated max descriptors: 1024, initial socket boundary: 16
 9 Apr 15:43:43 ntpd[4399]: Listen and drop on 0 v6wildcard [::]:123
 9 Apr 15:43:43 ntpd[4399]: Listen and drop on 1 v4wildcard 0.0.0.0:123
 9 Apr 15:43:43 ntpd[4399]: Listen normally on 2 lo 127.0.0.1:123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
 9 Apr 15:43:43 ntpd[4399]: Listen normally on 3 eth1 134.96.222.6:123
restrict: op 1 addr 134.96.222.6 mask 255.255.255.255 mflags 00003000 flags 00000001
 9 Apr 15:43:43 ntpd[4399]: Listen normally on 4 vpn0 134.96.160.58:123
restrict: op 1 addr 134.96.160.58 mask 255.255.255.255 mflags 00003000 flags 00000001
 9 Apr 15:43:43 ntpd[4399]: Listen normally on 5 lo [::1]:123
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
 9 Apr 15:43:43 ntpd[4399]: Listen normally on 6 eth1 [fe80::222:4dff:fe89:589a%4]:123
restrict: op 1 addr fe80::222:4dff:fe89:589a%4 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00003000 flags 00000001
 9 Apr 15:43:43 ntpd[4399]: Listening on routing socket on fd #23 for interface updates
restrict: op 1 addr 0.0.0.0 mask 0.0.0.0 mflags 00000000 flags 000005f0
restrict: op 1 addr :: mask :: mflags 00000000 flags 000005f0
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00000000 flags 00000000
restrict: op 1 addr ::1 mask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff mflags 00000000 flags 00000000
event at 0 0.0.0.0 c016 06 restart
peer_name_resolved(0.arch.pool.ntp.org) rescode 0
key_expire: at 0 associd 41893
peer_clear: at 0 next 2 associd 41893 refid INIT
event at 0 81.88.24.155 8011 81 mobilize assoc 41893
newpeer: 134.96.160.58->81.88.24.155 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
peer_name_resolved(1.arch.pool.ntp.org) rescode 0
key_expire: at 0 associd 41894
peer_clear: at 0 next 5 associd 41894 refid INIT
event at 0 80.70.176.51 8011 81 mobilize assoc 41894
newpeer: 134.96.160.58->80.70.176.51 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
peer_name_resolved(2.arch.pool.ntp.org) rescode 0
key_expire: at 0 associd 41895
peer_clear: at 0 next 5 associd 41895 refid INIT
event at 0 85.10.240.253 8011 81 mobilize assoc 41895
newpeer: 134.96.160.58->85.10.240.253 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
peer_name_resolved(3.arch.pool.ntp.org) rescode 0
key_expire: at 0 associd 41896
peer_clear: at 0 next 3 associd 41896 refid INIT
event at 0 129.70.132.35 8011 81 mobilize assoc 41896
newpeer: 134.96.160.58->129.70.132.35 mode 3 vers 4 poll 6 10 flags 0x101 0x1 ttl 0 key 00000000
select() returned -1: Interrupted system call
auth_agekeys: at 1 keys 0 expired 0
select() returned -1: Interrupted system call
transmit: at 2 134.96.160.58->81.88.24.155 mode 3 len 48
select() returned -1: Interrupted system call
transmit: at 3 134.96.160.58->129.70.132.35 mode 3 len 48
select() returned -1: Interrupted system call
select() returned -1: Interrupted system call
transmit: at 5 134.96.160.58->85.10.240.253 mode 3 len 48
transmit: at 5 134.96.160.58->80.70.176.51 mode 3 len 48
select() returned -1: Interrupted system call
select() returned -1: Interrupted system call
select() returned -1: Interrupted system call
...

and then the command hangs repeating the "Interrupted system call" message endlessly.

Last edited by knue (2015-04-09 12:43:12)

Offline

#2 2015-04-09 14:40:16

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,287

Re: ntpd -q hangs

I've not used ntpd for some time.  IIRC, something happened where it had to be run with elevated privilege.   Did you try it as root?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2015-04-09 15:08:08

knue
Member
Registered: 2011-10-11
Posts: 27

Re: ntpd -q hangs

yes, I've issued above command as root.

Offline

#4 2015-04-09 23:36:55

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: ntpd -q hangs

Do you get a response from the ntp server?

ping -c 3 0.arch.pool.ntp.org

Offline

#5 2015-04-10 10:18:55

knue
Member
Registered: 2011-10-11
Posts: 27

Re: ntpd -q hangs

yes

Offline

#6 2015-04-10 10:58:10

knue
Member
Registered: 2011-10-11
Posts: 27

Re: ntpd -q hangs

this is the relevant output I get with strace for the interrupted system call:

select(24, [16 17 18 19 20 21 22 23], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn({mask=[]})                 = -1 EINTR (Interrupted system call)
write(1, "select() returned -1: Interrupte"..., 46select() returned -1: Interrupted system call
) = 46

Offline

#7 2015-04-10 19:46:53

pszafer
Member
Registered: 2015-01-22
Posts: 39

Re: ntpd -q hangs

did you try sniff if some packets are coming back to you and if yes, what is in those reponses?

Offline

#8 2015-04-15 22:48:37

knue
Member
Registered: 2011-10-11
Posts: 27

Re: ntpd -q hangs

not yet. what's a quick way of doing this?

Last edited by knue (2015-04-15 22:49:58)

Offline

#9 2015-04-15 22:56:14

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: ntpd -q hangs

knue wrote:

Here is the official explanation:
[https://barlog.rusu.info/valentin/blog/?p=395]

short answer: we have to wait till all kde5 applications are ported to KF5.

Did you reply to the wrong thread knue?

Offline

#10 2015-04-16 10:57:37

knue
Member
Registered: 2011-10-11
Posts: 27

Re: ntpd -q hangs

yes, I edited the correct reply above, but apparently you were faster smile
anyway, what's a quick way of doing this sniffing?

Last edited by knue (2015-04-16 10:57:48)

Offline

#11 2015-04-16 11:53:42

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: ntpd -q hangs

tcpdump or wireshark

Offline

#12 2015-05-27 13:55:12

cro
Member
From: Germany
Registered: 2006-01-02
Posts: 101

Re: ntpd -q hangs

I had the same problem.
And I checked with tcpdump and I think it was simply because ntpd got no answer from the servers, probably firewalled.
When I use time servers from my network, it works as normal.
Question is why ntpd keeps waiting for so long that one might think it hangs? I think that doesn't make much sense, especially considering the purpose is synchronizing clocks.

Last edited by cro (2015-05-27 13:56:18)

Offline

#13 2015-05-27 23:33:11

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: ntpd -q hangs

Try "ntpq -qn".

Tim

Offline

#14 2015-05-28 13:47:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,116

Re: ntpd -q hangs

That won't work, try  ntpq -p or ntpq -pd .

Last edited by Lone_Wolf (2015-05-28 13:47:29)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Online

#15 2015-05-29 18:32:29

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: ntpd -q hangs

Sorry, my mistake. I meant -pn. I've been using systemd-timesyncd so long, I'm forgetting the ntp commands.

Tim

Last edited by ratcheer (2015-05-29 18:33:33)

Offline

Board footer

Powered by FluxBB