Re: Gui for configuring NTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 09 December 2005 14:36, Paul Smith wrote:
>On 12/9/05, Terry Polzin <fox3ec208@xxxxxxxxxxxxxxxx> wrote:
>> > Is there some gui for configuring NTP?
>>
>> /usr/bin/system-config-time
>
>Thanks, Terry. But getting
>
># /sbin/service ntpd restart
>Shutting down ntpd:                                        [  OK  ]
>ntpd: Synchronizing with time server:                      [FAILED]
>Starting ntpd:                                             [  OK  ]
>#
>
>whatever server I choose.
>
>Paul

Your systems clock must be within 500ppm of real time after ntpdate 
sets it at the startup above.  John Stultz wrote a little python 
thingy that should be run for about 10 minutes, with ntpd shut down, 
that will show you what the capability is.  IIRC its called 
test-drift.py or something like that.

Here is my local copy if I can find it again:
---------------cut here------------
#!/usr/bin/python
import commands
import sys
import string
import time


#default args
server = ""
sleep_time = 60

#parse args
if len(sys.argv) > 1:
 server = sys.argv[1]
if len(sys.argv) > 2:
 sleep_time = string.atoi(sys.argv[2])
#set time
cmd = commands.getoutput('/usr/sbin/ntpdate -ub ' + server)

cmd = commands.getoutput('/usr/sbin/ntpdate -uq ' + server)
line = string.split(cmd)

#parse original offset
start_offset = string.atof(line[-2]);
#parse original time
start_time = time.localtime(time.time())
datestr = time.strftime("%d %b %Y %H:%M:%S", start_time)

time.sleep(1)
while 1:
 cmd = commands.getoutput('/usr/sbin/ntpdate -uq ' + server)
 line = string.split(cmd)

 #parse offset
 now_offset = string.atof(line[-2]);

 #parse time
 now_time = time.localtime(time.time())
 datestr = time.strftime("%d %b %Y %H:%M:%S", now_time)

 # calculate drift
 delta_time = time.mktime(now_time) - time.mktime(start_time)
 delta_offset = now_offset - start_offset
 drift =  delta_offset / delta_time * 1000000
 #print output
 print time.strftime("%d %b %H:%M:%S",now_time), 
 print " offset:", now_offset , 
 print " drift:", drift ,"ppm"
 sys.stdout.flush()

 #sleep 
 time.sleep(sleep_time)
--------------cut here--------------
If your clock isn't good enough, and the mobo has an nforce2 chipset, 
try updating the bios, it helped me, a lot.

If the drift this script reports is usable, then try 
deleting /var/lib/ntp/drift, which will be recreated from scratch by 
ntpd after it has achieved a stable lock with whatever server it winds 
up peering to.

-- 
Cheers, Gene
People having trouble with vz bouncing email to me should use this
address: <gene.heskett@xxxxxxxxxxxxxxxxx> which bypasses vz's
stupid bounce rules.  I do use spamassassin too. :-)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2005 by Maurice Eugene Heskett, all rights reserved.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux