Bug 206127 - On a laptop with WIFI internet connection only, NTPD doesn't synchronise with the NTP servers
On a laptop with WIFI internet connection only, NTPD doesn't synchronise with...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: ntp (Show other bugs)
5
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Lichvar
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-12 06:37 EDT by Gerard Fernandes
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-06 11:39:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
NTP not working (491.76 KB, image/png)
2007-01-19 08:13 EST, Gerard Fernandes
no flags Details
With NM turned off after restarting the machine (563.82 KB, image/png)
2007-01-19 09:03 EST, Gerard Fernandes
no flags Details

  None (edit)
Description Gerard Fernandes 2006-09-12 06:37:02 EDT
Description of problem: On a laptop thats only ever connected via WiFi
(GnomeNetworkManager), 'ntpd' never synchronises with the NTP servers.
[root@achiles ~]# ntpstat
unsynchronised
  time server re-starting
   polling server every 64 s

However, on connecting via cable, 'ntpd' correctly synchronises with the NTP
servers.

Version-Release number of selected component (if applicable): latest updated FC5
as of 12-Sept-2006.


How reproducible: Always


Steps to Reproduce:
1. Configure your laptop to connect via WiFi using the GnomeNetworkManager program.
2. Shutdown/restart and run ntpstat as normal user or root
  
Actual results:
ntp is always unsynchronized

Expected results:
ntp should show synchronized state as it does when connected directly to the
internet via ethernet cable.


Additional info:
Comment 1 Gerard Fernandes 2006-09-12 06:40:14 EDT
After repeatedly running 'ntpstat' as root for about 10 minutes, it finally shows:
[root@achiles ~]# ntpstat
synchronised to NTP server (192.245.169.15) at stratum 2
   time correct to within 11 ms
   polling server every 64 s

Why does it not synchronise automatically, immediately after WiFi connection is
established?
Comment 2 Miroslav Lichvar 2006-09-12 08:11:55 EDT
Can you post the output from "/usr/sbin/ntpq -pn" corresponding to the ntpstat 
unsynchronised and synchronised state?
Comment 3 Gerard Fernandes 2006-09-12 17:55:50 EDT
In the unsynchronized state:

[root@achiles ~]# /usr/sbin/ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 127.127.1.0     LOCAL(0)        10 l   51   64    7    0.000    0.000   0.002
[root@achiles ~]# ntpstat
unsynchronised
  time server re-starting
   polling server every 64 s
[root@achiles ~]#
Comment 4 Gerard Fernandes 2006-09-12 17:57:21 EDT
In the synchronized state:

[root@achiles ~]# ntpstat
synchronised to local net at stratum 11
   time correct to within 449 ms
   polling server every 64 s
[root@achiles ~]# /usr/sbin/ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.1.0     LOCAL(0)        10 l   35   64   37    0.000    0.000   0.002
[root@achiles ~]#
Comment 5 Miroslav Lichvar 2006-09-13 05:00:28 EDT
The ntpq output doesn't show any ntp server. Looks like the network interface
was enabled after ntpd has started. Unfortunately ntpd version that is in FC5
can't handle this situation. Upstream has fixed it in development version, will
be in ntp-4.2.4.

The workaround is to not use NetworkManager or restart the ntp service manually
when the interface is ready.
Comment 6 Gerard Fernandes 2006-09-13 18:20:09 EDT
That does indeed seem to be the problem - there are many other little things
that do not work with NetworkManager/WiFi without manual intervention. The Gnome
Weather applet is one such little thing.

Anyway, my problem was a little to do with the fact that ntpd doesn't seem to
handle a late network start (a-la NetworkManager/WiFi) and the fact that the
hardware clock keeps drifting because of 191458 - which I hear is fixed in FC6
as well.
Comment 7 Gerard Fernandes 2007-01-19 08:11:19 EST
This seems to be happening on a desktop connected to a wired LAN!!!! See
attached screenshot - my desktop is almost 7 minutes off!!!!
Comment 8 Gerard Fernandes 2007-01-19 08:13:18 EST
Created attachment 145979 [details]
NTP not working

This is a screenshot on a Dell desktop with a dual core Intel processor, 1GB
RAM and a WIRED connection to the internet.
Comment 9 Miroslav Lichvar 2007-01-19 08:18:57 EST
Can you post the output from "/usr/sbin/ntpq -pn" command?
Comment 10 Gerard Fernandes 2007-01-19 08:24:41 EST
I can't believe this is not working!! It works on my second Windows(!?!?!?!)
desktop and it doesn't on FC6 - I've updated it this morning.

How can this million-year-old utility work on Windows and not work on
GNU/Linux?!?!?!?!

[root@ ~]# ntpstat
synchronised to local net at stratum 11 
   time correct to within 11 ms
   polling server every 1024 s
[root@ ~]# 
[root@ ~]# 
[root@ ~]# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.1.0     .LOCL.          10 l   55   64  377    0.000    0.000   0.001
 80.239.2.146    .INIT.          16 -    - 1024    0    0.000    0.000   0.000
 80.51.167.97    .INIT.          16 -    - 1024    0    0.000    0.000   0.000
 84.16.227.218   .INIT.          16 -    - 1024    0    0.000    0.000   0.000
[root@ ~]# 
Comment 11 Miroslav Lichvar 2007-01-19 08:37:09 EST
Ok, it doesn't work because ntpd couldn't reach any of the configured servers.

Are you using NetworkManager? If yes, this may be the same problem as with wifi
connection, the ntpd daemon is started earlier than the connection.
Comment 12 Gerard Fernandes 2007-01-19 08:45:06 EST
Yes... but I was under the impression that this was fixed in FC6? Am disabling
NetworkManager on my desktop for now. Can't do so on my laptop for obvious
reasons. It would be nice if ntpd could be dependent on NetworkManager and
therefore, started after NetworkManager.
Comment 13 Miroslav Lichvar 2007-01-19 08:54:25 EST
Well, it should work with ntp-4.2.4-1.fc6. The package is in the updates-testing
repository for a few days.

If you have already the package installed, please send me output of
grep ntpd /var/log/messages*
Comment 14 Gerard Fernandes 2007-01-19 09:00:11 EST
Ok. I currently have ntp-4.2.2p4-2.fc6 from stable. In any case, it doesn't seem
to be related to NetworkManager. I've just restarted my machine with
NetworkManager turned off and the time is still 6 minutes off!

======================================================================
[root@ ~]# ntpstat
synchronised to local net at stratum 11 
   time correct to within 448 ms
   polling server every 64 s
[root@ ~]# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 81.210.192.102  .INIT.          16 u    -   64    0    0.000    0.000   0.000
 66.33.216.11    .INIT.          16 u    -   64    0    0.000    0.000   0.000
 63.111.165.21   .INIT.          16 u    -   64    0    0.000    0.000   0.000
*127.127.1.0     .LOCL.          10 l   35   64   37    0.000    0.000   0.001

Attaching another screenshot with NetworkManager turned off and after a restart
of the machine.
Comment 15 Gerard Fernandes 2007-01-19 09:03:02 EST
Created attachment 145982 [details]
With NM turned off after restarting the machine

Screenshot with NetworkManager turned off and the machine restarted.
Comment 16 Miroslav Lichvar 2007-01-19 09:10:14 EST
Then it's a network problem. Try pinging the servers and
/usr/sbin/ntpdate -q 81.210.192.102
Comment 17 Gerard Fernandes 2007-01-19 09:14:03 EST
Yes, you're right.

[root@ ~]# ntpdate -q 81.210.192.102
server 81.210.192.102, stratum 0, offset 0.000000, delay 0.00000
19 Jan 14:06:06 ntpdate[3487]: no server suitable for synchronization found

I'll have to work with my corporate network to resolve this. Sorry for the
bother and thanks for the help.
Comment 18 Gerard Fernandes 2007-01-19 10:09:28 EST
Quick update:
I have NetworkManager running again. NetworkManager doesn't seem to be
interfering as ntpd seems to remain unsynchronized a significant bit after I'm
logged in. Something in the range of 5-8 minutes. Since ntpd synchronizes so
late, I'm guessing NetworkManager has nothing to do with its state.

The problem (in my case) was of course that ntp traffic was blocked by the
corporate firewall. There was however and in-house ntp server that I've
configured now and all's well - even with NetworkManager running.

Comment 19 Miroslav Lichvar 2007-02-06 11:39:10 EST
ntp-4.2.4 is in FC6 updates.

Note You need to log in before you can comment on or make changes to this bug.