You are not logged in.

#1 2005-12-10 01:42:59

Jedi Stannis
Member
Registered: 2004-09-10
Posts: 65

NTP Isuues

My clock seems to skew rather fast so I setup NTP but it doesn't seem to help that much.  ntpdate will synchronize the clock well but just running the ntp deamon doesn't keep my clock in sync... any ideas?  Should I try using OpenNTP instead?

Offline

#2 2005-12-10 02:15:43

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: NTP Isuues

ntpd is supposed to adjust your time gradually so that its not noticeable to the system. How far off is it and how long ago did you run ntpdate?

Offline

#3 2005-12-10 07:51:24

Jedi Stannis
Member
Registered: 2004-09-10
Posts: 65

Re: NTP Isuues

I have it set to ntpdate on boot before starting ntpd.  I havent done any exact calculations, but it appears that after having the correct time at boot it will drift at a rate of about a minute every couple days which adds up to a noticeable amount after a week or two.

Offline

#4 2005-12-10 12:05:44

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: NTP Isuues

maybe stop the daemon and clear out your drift file in /etc/ntp.drift?
here's my config if it helps;

restrict default noquery notrust nomodify
restrict 127.0.0.1
server clock1.unc.edu
restrict clock1.unc.edu noquery nomodify
driftfile /etc/ntp.drift
logfile /var/log/ntp.log

Offline

#5 2005-12-11 06:40:26

Jedi Stannis
Member
Registered: 2004-09-10
Posts: 65

Re: NTP Isuues

thanks for the advice... i cleared the drift file and i compared your config file to mine and made some changes i think might help, i'll let you know wether or not they eliminate the drift.  thanks again for your help.

Offline

#6 2005-12-15 22:46:41

Jedi Stannis
Member
Registered: 2004-09-10
Posts: 65

Re: NTP Isuues

the conf file you posted seemed to make it work until i reset, i noticed the drift came back.  checking my conf file again it seems to have changed itself.  it seems to change itself to:
ntp.conf:

restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0
fudge 127.127.1.0 stratum 3
server 127.127.1.0
driftfile /etc/ntp.drift
logfile /var/log/ntp.log

i have no idea why it would change itself to this, or what 127.127.1.0 is.  any idea whats up?  any idea how to keep it from changing?

Offline

#7 2005-12-16 08:16:30

xterminus
Member
From: Tacoma, WA, USA, Earth, Sol, M
Registered: 2005-10-30
Posts: 93

Re: NTP Isuues

Jedi Stannis wrote:

the conf file you posted seemed to make it work until i reset, i noticed the drift came back.  checking my conf file again it seems to have changed itself.  it seems to change itself to:
ntp.conf:

restrict default noquery notrust nomodify
restrict 127.0.0.1
restrict 192.168.1.0 mask 255.255.255.0
fudge 127.127.1.0 stratum 3
server 127.127.1.0
driftfile /etc/ntp.drift
logfile /var/log/ntp.log

i have no idea why it would change itself to this, or what 127.127.1.0 is.  any idea whats up?  any idea how to keep it from changing?

Try adding -N to /etc/conf.d/dhcpcd (man dhcpcd)

My guess is your dhcp server is overwriting your ntp settings (like it's supposed to).  If your running an ntp server, you'll want to disable this behavior.  You also might want to sync ntp with an external server.  Here's my config, which is about 3 years old but still works. (that's a lie, mine is more complex, but this should work)

# /etc/ntp.conf, configuration for ntpd

# By default, everyone can get time, nothing else
restrict  default  nomodify  nopeer

# Our Servers that we Sync with (this is the acl list, not the serverlist).
restrict 192.5.41.40 mask 255.255.255.255    # tick.usno.navy.mil
restrict 192.5.41.41 mask 255.255.255.255    # tock.usno.navy.mil

# allow unlimited access within our lan
#
restrict 10.0.0.0 mask 255.255.255.0

# We need to sync ourselves too!
restrict 127.0.0.1 mask 255.255.255.255

# ntpd will use syslog() if logfile is not defined
logfile /var/log/ntpd

driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Now list servers we sync with.

server 192.5.41.40     # tick.usno.navy.mil
server 192.5.41.41     # tock.usno.navy.mil

As to your drift - rate.  Make sure your syncing properly to an external ntp server correctly.  If not, ntp has no data upon which to calculate your clock's drift rate.  Pointing ntp to itself is pretty useless.  You can check peer status anytime with a

bashprompt> ntpq
ntpq> peers
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp0.usno.navy.    192.5.41.40   2 u  168  256  377   81.951   99.523  16.175
+tock.usno.navy.    192.5.41.41   2 u  100  256  377   87.683   86.640  11.506

if it shows something like:

 ntp0.usno.navy. .STEP.          16 u  16h 1024    0    0.000    0.000 4000.00
 tock.usno.navy. .STEP.          16 u  16h 1024    0    0.000    0.000 4000.00

Try another ntp server.  You can find a list of stratum-2 time servers at http://ntp.isc.org/bin/view/Servers/WebHome

And FYI:  Once ntpd is running correctly, you should never *need* to use ntpdate again.  It's a simple tool to sync up once.  After that your ntp daemon shouldn't drift far enough that it wont be able to sync up with an external time server.  So adding it to your boot process is just going to make your boot take longer (without any benefit)

Offline

#8 2005-12-16 19:00:30

Jedi Stannis
Member
Registered: 2004-09-10
Posts: 65

Re: NTP Isuues

hey xterminus

thanks, dhcp rewriting it is probably the cause.  i think i should be fine as long as the -N stops it from being overridden, as i only get the drift when im not actually connected to the ntp server due to the fact that dhcp messed up my conf file.  hopefully everything should be fine now, thanks for the information.

Offline

#9 2007-04-28 21:57:18

dtandersen
Member
Registered: 2007-01-30
Posts: 41

Re: NTP Isuues

I just had the same issue.  Add -N to DHCPCD_ARGS in /etc/conf.d/dhcpcd as documented in http://wiki.archlinux.org/index.php/NTP

Last edited by dtandersen (2007-04-28 21:58:19)

Offline

Board footer

Powered by FluxBB