[lug] NTP question

Neal McBurnett neal at bcn.boulder.co.us
Mon Mar 17 19:07:16 MST 2003


The NTP daemon is for *tracking* good time, and will only sync if you
are close - a protection to avoid causing cron problems and other
weird things if your machine or your ntp peers are really fouled up
due to time-zone problems, etc.

ntpdate is the sort of thing to use to *set* good time before starting
ntpd up, since that makes ntp it get to a good frequency much more
quickly.

The redhat init scripts, e.g. are designed to do this right:

/etc/init.d/ntpd

So just install ntp, and say "service ntpd start"

Looks like it uses either /etc/ntp/step-tickers or there is a "-g"
option to ntpd to permit it to make a big change.

Neal McBurnett                 http://bcn.boulder.co.us/~neal/
GPG/PGP signed and/or sealed mail encouraged.  Keyid: 2C9EBA60


On Mon, Mar 17, 2003 at 06:32:35PM -0700, Steve Sullivan wrote:
> Hi,
> 
> I'm learning to use NTP, but it doesn't seem to work.
> I'm running Redhat 7.3 on a pentium.
> 
> ntpdate works great.
> 
> So I decided to try ntpd.  I deliberately set my clock 20 seconds off,
> and set up /etc/ntp.conf.  Then I started /etc/rc.d/init.d/ntpd,
> and waited.  And waited.  And waited.  45 minutes later and my clock
> is still 20 seconds off.  What am I doing wrong here?
> 
> Here is my /etc/ntpd file:
> =========== /etc/ntpd ========
> restrict default ignore
> restrict 127.0.0.1 
> server 204.34.198.41
> server 132.163.4.103
> server 128.138.140.44
> server 164.67.62.194
> driftfile /etc/ntp/drift
> ========== end file ========
> 
> And the only log entries during that period are ...
> Mar 17 17:49:23 helix ntpd[27373]: ntpd 4.1.1 at 1.786 Mon Apr  8 06:30:52 EDT 2002 (1)
> Mar 17 17:49:23 helix ntpd[27373]: precision = 31 usec
> Mar 17 17:49:23 helix ntpd[27373]: kernel time discipline status 0040
> Mar 17 17:49:23 helix ntpd[27373]: frequency initialized 0.000 from /etc/ntp/drift
> Mar 17 17:49:23 helix ntpd: ntpd startup succeeded
> 
> 
> Meanwhile it appears that ntpd hasn't touched a thing in file /etc/ntp:
> $ ls -al /etc/ntp  
>    4 drwxr-xr-x    2 ntp      ntp          4096 May  8  2002 ./
>    8 drwxr-xr-x   79 root     root         8192 Mar 17 17:47 ../
>    4 -rw-r--r--    1 ntp      ntp             4 Apr  8  2002 drift
>    4 -rw-------    1 root     root          266 Apr  8  2002 keys
>    0 -rw-r--r--    1 root     root            0 Apr  8  2002 step-tickers
> 
> 
> What have I overlooked here?
> 
> Many thanks!
> 
> Steve
> 
> 
> 
> ========================================
> Steve Sullivan    sullivan at mathcom.com
> 
>    Mathcom Solutions Inc.: Custom Software Development.
>     * Mathematical optimization, simulation, and modeling.
>     * Data mining, information retrieval.
>     * Java, XML, C++, Mathematica, Matlab, XSLT, XQuery, SOAP, RMI, ...
> 
> http://www.mathcom.com    303-494-7115
> ========================================
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug



More information about the LUG mailing list