LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-18-2013, 08:02 AM   #1
bknapek
LQ Newbie
 
Registered: Dec 2009
Distribution: Slackware
Posts: 18

Rep: Reputation: 1
ntpd/ntpdate fail under X


Ntpd/ntpdate fail when I execute the commands from a remote desktop (NXserver/KDE).
Locally, or via SSH - everything works just fine!


In a remote desktop I get the following results:

Code:
root@matylda:/etc# ntpdate -d -4 tempus1.gum.gov.pl
18 Nov 14:04:30 ntpdate[21465]: ntpdate 4.2.6p5@1.2349 Mon Oct 14 07:59:33 UTC 2013 (1)
Looking for host tempus1.gum.gov.pl and service ntp
host found : tempus1.gum.gov.pl
And it keeps hanging like this.
(I have used "-4" to rule out ipv6 issues)


Wireshark does not show any activity towards the ntp server.
No packet is sent to tempus1.gum.gov.pl.

The host is reachable - ntptrace works for it:
Code:
root@matylda:/etc# ntptrace tempus1.gum.gov.pl
tempus1.gum.gov.pl: stratum 1, offset 0.000001, synch distance 0.000000, refid 'PPS'
Running ntpd I get the following:

ntpd -g -d -4
Code:
root@matylda:/etc# ntpd -g -d -4
ntpd 4.2.6p5@1.2349 Mon Oct 14 07:59:32 UTC 2013 (1)
18 Nov 14:18:28 ntpd[21750]: proto: precision = 0.115 usec
event at 0 0.0.0.0 c01d 0d kern kernel time sync enabled
Finished Parsing!!
18 Nov 14:18:28 ntpd[21750]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
18 Nov 14:18:28 ntpd[21750]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
18 Nov 14:18:28 ntpd[21750]: Listen normally on 1 lo 127.0.0.1 UDP 123
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00003000 flags 00000001
18 Nov 14:18:28 ntpd[21750]: Listen normally on 2 eth0 192.168.0.12 UDP 123
restrict: op 1 addr 192.168.0.12 mask 255.255.255.255 mflags 00003000 flags 00000001
18 Nov 14:18:28 ntpd[21750]: Listen normally on 3 br0 192.168.14.1 UDP 123
restrict: op 1 addr 192.168.14.1 mask 255.255.255.255 mflags 00003000 flags 00000001
18 Nov 14:18:28 ntpd[21750]: peers refreshed
18 Nov 14:18:28 ntpd[21750]: Listening on routing socket on fd #20 for interface updates
restrict: op 1 addr 0.0.0.0 mask 0.0.0.0 mflags 00000000 flags 000000c0
restrict: op 1 addr :: mask 0.0.0.0 mflags 00000000 flags 000000c0
restrict: op 1 addr 127.0.0.1 mask 255.255.255.255 mflags 00000000 flags 00000000
restrict: op 1 addr 192.168.14.0 mask 255.255.255.0 mflags 00000000 flags 00000080
18 Nov 14:18:28 ntpd[21750]: logconfig: '' not recognized - ignored
18 Nov 14:18:28 ntpd[21750]: logging to file /var/log/ntp.log
peer_clear: at 0 next 1 associd 5279 refid INIT
18 Nov 14:18:28 ntpd[21750]: LOCAL(0) 8011 81 mobilize assoc 5279
event at 0 LOCAL(0) 8011 81 mobilize assoc 5279
newpeer: 127.0.0.1->127.127.1.0 mode 3 vers 4 poll 6 6 flags 0x9 0x1 ttl 0 key 00000000
peer_clear: at 0 next 2 associd 5280 refid INIT
18 Nov 14:18:28 ntpd[21750]: 212.244.36.227 8011 81 mobilize assoc 5280
event at 0 212.244.36.227 8011 81 mobilize assoc 5280
newpeer: 192.168.0.12->212.244.36.227 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0 key 00000000
peer_clear: at 0 next 3 associd 5281 refid INIT
18 Nov 14:18:28 ntpd[21750]: 212.244.36.228 8011 81 mobilize assoc 5281
event at 0 212.244.36.228 8011 81 mobilize assoc 5281
newpeer: 192.168.0.12->212.244.36.228 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0 key 00000000
peer_clear: at 0 next 4 associd 5282 refid INIT
18 Nov 14:18:28 ntpd[21750]: 153.19.250.123 8011 81 mobilize assoc 5282
event at 0 153.19.250.123 8011 81 mobilize assoc 5282
newpeer: 192.168.0.12->153.19.250.123 mode 3 vers 4 poll 6 10 flags 0x1 0x1 ttl 0 key 00000000
18 Nov 14:18:28 ntpd[21750]: 0.0.0.0 c016 06 restart
event at 0 0.0.0.0 c016 06 restart
18 Nov 14:18:28 ntpd[21750]: 0.0.0.0 c012 02 freq_set kernel 7.483 PPM
event at 0 0.0.0.0 c012 02 freq_set kernel 7.483 PPM
And nothing more happens.

ntpq -p
Code:
root@matylda:/etc# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        .LOCL.          10 l    -   64    0    0.000    0.000   0.000
 tempus1.gum.gov .INIT.          16 u    -   64    0    0.000    0.000   0.000
 tempus2.gum.gov .INIT.          16 u    -   64    0    0.000    0.000   0.000
 ntp.task.gda.pl .INIT.          16 u    -   64    0    0.000    0.000   0.000
ntpq
Code:
root@matylda:/etc# ntpq
ntpq> as

ind assid status  conf reach auth condition  last_event cnt
===========================================================
  1  5279  8011   yes    no  none    reject    mobilize  1
  2  5280  8011   yes    no  none    reject    mobilize  1
  3  5281  8011   yes    no  none    reject    mobilize  1
  4  5282  8011   yes    no  none    reject    mobilize  1
ntpq> q
/var/log/ntp.log
Code:
root@matylda:/etc# tail /var/log/ntp.log 
18 Nov 14:17:53 ntpd[21735]: 153.19.250.123 8011 81 mobilize assoc 34746
18 Nov 14:17:53 ntpd[21735]: 0.0.0.0 c016 06 restart
18 Nov 14:17:53 ntpd[21735]: 0.0.0.0 c012 02 freq_set kernel 7.483 PPM
18 Nov 14:18:05 ntpd[21735]: ntpd exiting on signal 2
18 Nov 14:18:28 ntpd[21750]: LOCAL(0) 8011 81 mobilize assoc 5279
18 Nov 14:18:28 ntpd[21750]: 212.244.36.227 8011 81 mobilize assoc 5280
18 Nov 14:18:28 ntpd[21750]: 212.244.36.228 8011 81 mobilize assoc 5281
18 Nov 14:18:28 ntpd[21750]: 153.19.250.123 8011 81 mobilize assoc 5282
18 Nov 14:18:28 ntpd[21750]: 0.0.0.0 c016 06 restart
18 Nov 14:18:28 ntpd[21750]: 0.0.0.0 c012 02 freq_set kernel 7.483 PPM
Now, locally or via SSH - it just works!

Code:
root@matylda:~# ntpdate -d -v -4 tempus1.gum.gov.pl
18 Nov 14:28:42 ntpdate[22115]: ntpdate 4.2.6p5@1.2349 Mon Oct 14 07:59:33 UTC 2013 (1)
Looking for host tempus1.gum.gov.pl and service ntp
host found : tempus1.gum.gov.pl
transmit(212.244.36.227)
receive(212.244.36.227)
transmit(212.244.36.227)
receive(212.244.36.227)
transmit(212.244.36.227)
receive(212.244.36.227)
transmit(212.244.36.227)
receive(212.244.36.227)
server 212.244.36.227, port 123
stratum 1, precision -20, leap 00, trust 000
refid [PPS], delay 0.09122, dispersion 0.00163
transmitted 4, in filter 4
reference time:    d6349483.5ad19def  Mon, Nov 18 2013 14:28:35.354
originate timestamp: d6349490.2597c3d9  Mon, Nov 18 2013 14:28:48.146
transmit timestamp:  d6349490.1d3c2285  Mon, Nov 18 2013 14:28:48.114
filter delay:  0.10289  0.09773  0.09122  0.09151
         0.00000  0.00000  0.00000  0.00000
filter offset: 0.005040 -0.00407 -0.00058 -0.00046
         0.000000 0.000000 0.000000 0.000000
delay 0.09122, dispersion 0.00163
offset -0.000585

18 Nov 14:28:48 ntpdate[22115]: adjust time server 212.244.36.227 offset -0.000585 sec
And also ntpd starts without problems:

ntpq -p
Code:
root@matylda:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*LOCAL(0)        .LOCL.          10 l   50   64    1    0.000    0.000   0.000
 tempus1.gum.gov .PPS.            1 u   49   64    1   88.977   10.434   0.000
 tempus2.gum.gov .PPS.            1 u   48   64    1   66.138    0.294   0.000
 ntp.task.gda.pl 150.254.183.15   3 u   47   64    1   17.378   -5.732   0.000
/var/log/ntp.log
Code:
18 Nov 14:23:43 ntpd[21892]: LOCAL(0) 8011 81 mobilize assoc 34058
18 Nov 14:23:43 ntpd[21892]: 212.244.36.227 8011 81 mobilize assoc 34059
18 Nov 14:23:43 ntpd[21892]: 212.244.36.228 8011 81 mobilize assoc 34060
18 Nov 14:23:43 ntpd[21892]: 153.19.250.123 8011 81 mobilize assoc 34061
18 Nov 14:23:43 ntpd[21892]: 0.0.0.0 c016 06 restart
18 Nov 14:23:43 ntpd[21892]: 0.0.0.0 c012 02 freq_set kernel 7.483 PPM
18 Nov 14:23:44 ntpd[21892]: LOCAL(0) 8024 84 reachable
18 Nov 14:23:44 ntpd[21892]: LOCAL(0) 903a 8a sys_peer
18 Nov 14:23:44 ntpd[21892]: 0.0.0.0 c515 05 clock_sync
18 Nov 14:23:45 ntpd[21892]: 212.244.36.227 8024 84 reachable
18 Nov 14:23:46 ntpd[21892]: 212.244.36.228 8024 84 reachable
18 Nov 14:23:47 ntpd[21892]: 153.19.250.123 8024 84 reachable
ntp.conf
Code:
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

server tempus1.gum.gov.pl
server tempus2.gum.gov.pl
server ntp.task.gda.pl

driftfile /etc/ntp/drift
logfile /var/log/ntp.log
logconfig = +sysall +peerall +syncall +clockall

restrict 127.0.0.1
restrict 192.168.14.0 mask 255.255.255.0 nomodify
ifconfig
Code:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.14.1  netmask 255.255.255.0  broadcast 192.168.14.255
        inet6 fe80::52e5:49ff:fe35:dbdb  prefixlen 64  scopeid 0x20<link>
        ether 50:e5:49:35:db:db  txqueuelen 0  (Ethernet)
        RX packets 1030  bytes 203159 (198.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1144  bytes 217246 (212.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.12  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::230:4fff:fe52:3ea6  prefixlen 64  scopeid 0x20<link>
        ether 00:30:4f:52:3e:a6  txqueuelen 1000  (Ethernet)
        RX packets 2128816  bytes 2729485884 (2.5 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1047580  bytes 167986033 (160.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        inet6 fe80::52e5:49ff:fe35:dbdb  prefixlen 64  scopeid 0x20<link>
        ether 50:e5:49:35:db:db  txqueuelen 1000  (Ethernet)
        RX packets 17566  bytes 1968370 (1.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30041  bytes 6055376 (5.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 1872757  bytes 768051080 (732.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1872757  bytes 768051080 (732.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
route
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    203    0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     203    0        0 eth0
                localhost.      255.255.255.255 UGH   203    0        0 lo
192.168.14.0    *               255.255.255.0   U     0      0        0 br0
uname -a
Code:
Linux matylda 3.10.17 #1 SMP Wed Oct 23 16:28:33 CDT 2013 x86_64 Intel(R) Core(TM) i3-2100T CPU @ 2.50GHz GenuineIntel GNU/Linux
Looking at strace ntpdate.

remote desktop
Code:
:
setitimer(ITIMER_REAL, {it_interval={0, 200000}, it_value={0, 100000}}, NULL) = 0
setpriority(PRIO_PROCESS, 0, 4294967284) = 0
poll([{fd=3, events=POLLIN}], 1, 60000
while locally or via SSH the same place looks like this:
Code:
:
setitimer(ITIMER_REAL, {it_interval={0, 200000}, it_value={0, 100000}}, NULL) = 0
setpriority(PRIO_PROCESS, 0, 4294967284) = 0
poll([{fd=3, events=POLLIN}], 1, 60000) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
rt_sigreturn()                          = -1 EINTR (Interrupted system call)
write(1, "transmit(212.244.36.227)\n", 25transmit(212.244.36.227)
) = 25
sendto(3, "\343\0\3\372\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 48, 0, {sa_family=AF_INET, sin_port=htons(123), sin_addr=inet_addr("212.244.36.227")}, 16) = 48
:
:
What do you think?
What might be the problem?
What should I look at?

thanks/Bartek

Last edited by bknapek; 11-18-2013 at 11:34 AM. Reason: relized that the problem occurs over remote desktop, not when locally in X
 
Old 12-26-2013, 05:17 PM   #2
scolic
LQ Newbie
 
Registered: Mar 2006
Location: Belgrade,Serbia
Distribution: Slackware 14.1 x64
Posts: 5

Rep: Reputation: 0
Unhappy

I have the exact same problem, bump for some answer...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ntpdate XXX works ; ntpdate -q XXX don't works - ntpd stays on local oudoubah Linux - Software 5 12-12-2011 07:28 AM
ntpdate - ntpd czezz Solaris / OpenSolaris 6 09-02-2008 02:05 PM
ntpdate - ntpd czezz Solaris / OpenSolaris 1 08-27-2008 08:06 AM
NTPDATE -vs- NTPd? carlosinfl Linux - Networking 3 02-25-2007 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration