From: Theodore Heise on
On Tue, 3 Nov 2009 09:47:23 +0000 (UTC),
Petri Kaukasoina <kaukasoina802n54jc045(a)sci.fi> wrote:
> root <NoEMail(a)home.org> wrote:
>>After over two hours of operation I had drifted by 84 seconds,
>>which is just the drift I had always been getting.
>
> So, the rate of your clock is about 11700 ppm too fast or too
> slow. ntpd can fix the rate only if it's less than 500 ppm off
> if I remember right.
>
> Try this: first kill ntpd, then "adjtimex -f 0" to reset the
> frequency offset. Then give either "tickadj 10117" or "tickadj
> 9883" depending on whether your clock was 11700 ppm too slow or
> too fast. (10000 is the default value for tickadj). Don't start
> ntpd yet. Use the eyeball-and-wristwatch method to check if the
> clock is better now. Now ntpd should be able to control the
> clock.

Aha! Good catch, thanks for pointing it out!

--
Theodore (Ted) Heise <theo(a)heise.nu> Bloomington, IN, USA
From: Theodore Heise on
On Tue, 3 Nov 2009 16:05:52 +0000 (UTC),
root <NoEMail(a)home.org> wrote:
> root <NoEMail(a)home.org> wrote:
>>
>> I have restarted ntpd, and will check after running 100
>> minutes.

> According to my setting of tick, after 100 minutes the clock
> would have been off by 2 sec. Instead it was spot on. I
> continued the test, now after 440 minutes the clock is still
> perfect. ntpd is working now.
>
> Thanks to everyone.

Glad you were able to get it running! Nice persistence on your
part too, I might add.

--
Theodore (Ted) Heise <theo(a)heise.nu> Bloomington, IN, USA
From: geep on
On Mon, 02 Nov 2009 15:46:55 +0000, root wrote:

> After everyone's help, the damned thing still isn't working. I thought I
> was there when I got what looked like correct entries in the logfile,
> but one line was missing:
> 2 Nov 08:22:24 ntpd[3007]: synchronized to 65.255.217.202, stratum 3
>
> I didn't get synchronized to any server, even though ntpq -p showed I
> was in contact with three servers. After over two hours of operation I
> had drifted by 84 seconds, which is just the drift I had always been
> getting.

Hi,
Here's a copy of the script I run from rc.local to start and check ntp.
/etc/rc.d/rc.ntpd is already set executable.
e.g. -rwxr-xr-x 1 root root 561 2008-11-20 22:07 /etc/rc.d/rc.ntpd
Adjust to suit your own favourite timesource.
Cheers,
Peter

#!/bin/bash
#First, stop existing daemon
/etc/rc.d/rc.ntpd stop
#From http://support.ntp.org/bin/view/Support/GettingStarted
#3.2.4. "Manually" set the clock correctly just once
echo "Set the correct time..."
timeserver1="ntp1.npl.co.uk"
timeserver2="ntp2.npl.co.uk"
/usr/sbin/ntpdate -b $timeserver1 $timeserver2
#3.2.6. Keep the clock in sync permanently and continuously.
# (Having already setup /etc/ntp.conf)
/etc/rc.d/rc.ntpd start
#3.2.8. Check your work.
echo "Check time sync peers..."
/usr/sbin/ntpdc -c peers
#Check that ntpd daemon running for continuous time synch
echo "Check that ntpd daemon running for continuous time synch..."
echo -n " ntpd PID: "
/usr/bin/pgrep ntpd
/usr/sbin/ntpq -p
echo -n "Clock frequency drift="
cat /etc/ntp/drift
From: james on
root <NoEMail(a)home.org> wrote in news:hcmutf$f0f$1(a)news.albasani.net:

> After everyone's help, the damned thing still
> isn't working.

I had the same problem after updating ntpd on my box that is my
home time server. The solution was finding that the definitions
of some of the options of 'restrict' had changed. Changed to
the new option format and everything started working.

Here's my complete ntp.conf from the affected box (there are even
notes about what changed and where to find the docs):
#
# /etc/ntp.conf
driftfile /etc/ntp.drift
logfile /var/log/ntp.log
pidfile /var/run/ntp.pid

# next 2 lines is how ntpd queries the local clock.
# different addresses for different, specialized time sources
# stratum 15 so that we'll definitely be low on the list
# Hint: as of /usr/doc/ntp-4.2.0/html/notes.html 15 is highest stratum
# 8/17/2006 - we'll, we're syncing to ourselves again. comment this
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10

# The following servers hourly round-robin the actual time server
returned
# It helps balance load for upper level servers, but you need at least 3
# see http://www.ntp.org for others
# be friendly, don't use more than 3
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
#server 3.us.pool.ntp.org
#server 0.north-america.pool.ntp.org
#server 1.north-america.pool.ntp.org
#server 2.north-america.pool.ntp.org
#server 3.north-america.pool.ntp.org
#
#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will.
#
#keys /etc/ntp/keys
#trustedkey 65535
#requestkey 65535
#controlkey 65535

# In 4.2 and beyond, cryptographic stuff changed notrust and nomodify
# see: http://support.ntp.org/bin/view/Support/AccessRestrictions
# original default line:
# restrict default noquery notrust nomodify
# trust localhost and my subnet
restrict 127.0.0.1
restrict 192.168.42.0 mask 255.255.255.0 notrap


--
The email address, above, is most certainly munged. Perhaps you
might reply to the newsgroup, instead? Thanks!
From: Grant on
On Sat, 7 Nov 2009 18:33:27 +0000 (UTC), james <mentor(a)arisia.invalid> wrote:

>root <NoEMail(a)home.org> wrote in news:hcmutf$f0f$1(a)news.albasani.net:
>
>> After everyone's help, the damned thing still
>> isn't working.
>
>I had the same problem after updating ntpd on my box that is my
>home time server. The solution was finding that the definitions
>of some of the options of 'restrict' had changed. Changed to
>the new option format and everything started working.
>
>Here's my complete ntp.conf from the affected box (there are even
>notes about what changed and where to find the docs):
>#
># /etc/ntp.conf
>driftfile /etc/ntp.drift
>logfile /var/log/ntp.log
>pidfile /var/run/ntp.pid
>
># next 2 lines is how ntpd queries the local clock.
># different addresses for different, specialized time sources
># stratum 15 so that we'll definitely be low on the list
># Hint: as of /usr/doc/ntp-4.2.0/html/notes.html 15 is highest stratum
># 8/17/2006 - we'll, we're syncing to ourselves again. comment this
># Undisciplined Local Clock. This is a fake driver intended for backup
># and when no outside source of synchronized time is available. The
># default stratum is usually 3, but in this case we elect to use stratum
># 0. Since the server line does not have the prefer keyword, this driver
># is never used for synchronization, unless no other other
># synchronization source is available. In case the local host is
># controlled by some external source, such as an external oscillator or
># another protocol, the prefer keyword would cause the local host to
># disregard all other synchronization sources, unless the kernel
># modifications are in use and declare an unsynchronized condition.
>#
>server 127.127.1.0 # local clock
>fudge 127.127.1.0 stratum 10
>
># The following servers hourly round-robin the actual time server
>returned
># It helps balance load for upper level servers, but you need at least 3
># see http://www.ntp.org for others
># be friendly, don't use more than 3
>server 0.us.pool.ntp.org
>server 1.us.pool.ntp.org
>server 2.us.pool.ntp.org
>#server 3.us.pool.ntp.org
>#server 0.north-america.pool.ntp.org
>#server 1.north-america.pool.ntp.org
>#server 2.north-america.pool.ntp.org
>#server 3.north-america.pool.ntp.org
>#
>#
># Keys file. If you want to diddle your server at run time, make a
># keys file (mode 600 for sure) and define the key number to be
># used for making requests.
># PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
># systems might be able to reset your clock at will.
>#
>#keys /etc/ntp/keys
>#trustedkey 65535
>#requestkey 65535
>#controlkey 65535
>
># In 4.2 and beyond, cryptographic stuff changed notrust and nomodify
># see: http://support.ntp.org/bin/view/Support/AccessRestrictions
># original default line:
># restrict default noquery notrust nomodify
># trust localhost and my subnet
>restrict 127.0.0.1
>restrict 192.168.42.0 mask 255.255.255.0 notrap

FWIW here's mine, working properly for years:

~$ cat /etc/ntp.conf
# /etc/ntp.conf for slackware on deltree 2004-11-18
# 2005-03-02 Added tpg.com.au timeserver
#
# Configuration, see
# http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
# http://ntp.isc.org/bin/view/Support/ConfRestrict

# configure local clock as dummy refclock, making sure any clients
# know that it is not a high quality clock with stratum = 10
# Note that setting a dummy refclock seems a bad idea (2005-01-08)
#server 127.127.1.0
#fudge 127.127.1.0 stratum 10

# drift and log files
driftfile /etc/ntp/drift
#logfile /var/log/ntp_log

# Monitoring performance
# from: http://www.ntp.org/ntpfaq/NTP-s-trouble.htm
#statistics loopstats
#statsdir /var/log/
#filegen peerstats file peers type day link enable
#filegen loopstats file loops type day link enable

# Access control and server selection:

# set default restrictions
restrict default kod nomodify notrap nopeer noquery

# select time servers
server ntp2.tpg.com.au
server 0.au.pool.ntp.org
server 1.au.pool.ntp.org
server 2.au.pool.ntp.org
server au.pool.ntp.org

# restrict local server users less
restrict 127.0.0.1
restrict 192.168.3.0 mask 255.255.255.0 nomodify notrap nopeer
# end
--
http://bugsplatter.id.au
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: ntpd question
Next: slack 13 OpenOffice