[CentOS-de] Systemzeit galoppiert davon trotz ntpd und korrekten Zeitservern

Frank Thommen frank.thommen at embl-heidelberg.de
Do Feb 24 05:28:06 EST 2011


Tobias Crefeld wrote:
> Am Wed, 23 Feb 2011 14:16:01 +0100
> schrieb Frank Thommen <frank.thommen at embl-heidelberg.de>:
> 
>> auf einer (einzigen) Machine laeuft uns - wortwoertlich - die Zeit 
>> davon.  Seit der letzten harten Zeitsynchronisation (`ntpdate 
> [..]
> 
>> # 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
> 
> Ist nur eine Vermutung, aber schau Dir mal Inhalt und insbesondere
> Rechte dieses Files an:
> 
> $ ls -l /var/lib/ntp/drift
> -rw-r--r-- 1 ntp ntp 8 24. Feb 10:05 /var/lib/ntp/drift

Inhalt: 0.000 auf dem abdriftenden Rechner, -32.889 und -15.508 auf zwei 
korrekt getimten Rechnern.

Die Rechte sind auf allen Rechnern genau wie von Dir beschrieben


>> Aus irgendeinem Grund synchronisiert dieser Host aber mit der lokalen 
>> Uhr (?) statt mit unseren Zeitservern:
> 
> Dagegen spricht ja nichts, nur ist der Offset zu den Netzservern viel
> zu groß, um noch für eine Synchronisation genutzt werden zu können. 

Aber warum nimmt ntpd die lokale Uhr statt den Timeservern?  Ich habe 
die Systemzeit gestern etwa zur Mittagszeit gesetzt.  Unterdessen ist 
der Rechner fast zwei Stunden in der Zukunft.


>> Irgendeine Idee woran das liegen koennte oder wie man dem Problem auf 
>> die Schliche kommen koennte?
> 
> syslog fragen?
> cat /var/log/messages |grep ntpd

Leider nicht viel ausser den Mitteilungen beim Neustart von ntpd:

[...]
Feb 23 15:21:10 shelley ntpd[994]: ntpd exiting on signal 15
Feb 23 15:24:26 shelley ntpd[2966]: ntpd 4.2.2p1 at 1.1570-o Sat Dec 19 
00:56:13 UTC 2009 (1)
Feb 23 15:24:27 shelley ntpd[2967]: precision = 1.000 usec
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface wildcard, 
0.0.0.0#123 Disabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface wildcard, 
::#123 Disabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface lo, ::1#123 
Enabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface eth0, 
fec0::c:218:8bff:fe7f:b332#123 Enabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface eth0, 
2002:d5b3:d122:c:218:8bff:fe7f:b332#123 Enabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface eth0, 
fe80::218:8bff:fe7f:b332#123 Enabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface lo, 
127.0.0.1#123 Enabled
Feb 23 15:24:27 shelley ntpd[2967]: Listening on interface eth0, 
10.1.104.180#123 Enabled
Feb 23 15:24:27 shelley ntpd[2967]: kernel time sync status 0040
Feb 23 15:24:27 shelley ntpd[2967]: frequency initialized 0.000 PPM from 
/var/lib/ntp/drift
Feb 23 15:27:46 shelley ntpd[2967]: synchronized to LOCAL(0), stratum 10
Feb 23 15:27:46 shelley ntpd[2967]: kernel time sync enabled 0001
Feb 23 15:40:56 shelley ntpd[2967]: ntpd exiting on signal 15
Feb 23 15:18:20 shelley ntpd[4048]: ntpd 4.2.2p1 at 1.1570-o Sat Dec 19 
00:56:13 UTC 2009 (1)
Feb 23 15:18:20 shelley ntpd[4049]: precision = 1.000 usec
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface wildcard, 
0.0.0.0#123 Disabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface wildcard, 
::#123 Disabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface lo, ::1#123 
Enabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface eth0, 
fec0::c:218:8bff:fe7f:b332#123 Enabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface eth0, 
2002:d5b3:d122:c:218:8bff:fe7f:b332#123 Enabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface eth0, 
fe80::218:8bff:fe7f:b332#123 Enabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface lo, 
127.0.0.1#123 Enabled
Feb 23 15:18:20 shelley ntpd[4049]: Listening on interface eth0, 
10.1.104.180#123 Enabled
Feb 23 15:18:20 shelley ntpd[4049]: kernel time sync status 0040
Feb 23 15:18:20 shelley ntpd[4049]: frequency initialized 0.000 PPM from 
/var/lib/ntp/drift
Feb 23 15:21:36 shelley ntpd[4049]: synchronized to LOCAL(0), stratum 10
Feb 23 15:21:36 shelley ntpd[4049]: kernel time sync enabled 0001
[...]


> Ansonsten noch: /etc/sysconfig/ntpd vergleichen mit einem "sauberen"
> Host. Ggf. dort temporär "-d" oder "-dd" zwecks geschwätzigerem Logging
> eintragen.

/etc/sysconfig/ntpd uberall identisch:

-------
# Drop root to id 'ntp:ntp' by default.
OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"

# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate
NTPDATE_OPTIONS=""
-------

Mal schauen, was -dd bringt.

frank