# NTP setup

## badgers

Frequency format error in /var/lib/ntp/ntp.drift

is what I see in my messages since I added NTP to my myth box.

what should I do?

background info

myth_hostname ~ # tail -n 30 /var/log/messages

Sep  7 13:00:01 myth_hostname cron[6838]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 13:00:01 myth_hostname cron[6841]: (root) CMD (rm -f /var/spool/cron/lastrun/cron.hourly)

Sep  7 13:10:01 myth_hostname cron[6852]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 13:20:01 myth_hostname cron[6864]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 13:30:01 myth_hostname cron[6876]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 13:40:01 myth_hostname cron[6888]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 13:50:01 myth_hostname cron[6900]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:00:01 myth_hostname cron[6912]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:00:01 myth_hostname cron[6914]: (root) CMD (rm -f /var/spool/cron/lastrun/cron.hourly)

Sep  7 14:10:02 myth_hostname cron[6926]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:11:34 myth_hostname sshd[6937]: Accepted keyboard-interactive/pam for root from 12.20.65.30 port 30549 ssh2

Sep  7 14:11:34 myth_hostname sshd(pam_unix)[6943]: session opened for user root by root(uid=0)

Sep  7 14:20:01 myth_hostname cron[6948]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:30:01 myth_hostname cron[6960]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:40:01 myth_hostname cron[6972]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 14:50:01 myth_hostname cron[7032]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:00:01 myth_hostname cron[7044]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:00:01 myth_hostname cron[7046]: (root) CMD (rm -f /var/spool/cron/lastrun/cron.hourly)

Sep  7 15:10:01 myth_hostname cron[7058]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:20:01 myth_hostname cron[7070]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:30:01 myth_hostname cron[7082]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:40:01 myth_hostname cron[7241]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )

Sep  7 15:44:32 myth_hostname ntpd[7374]: ntpd 4.2.0a@1.1191-r Wed Sep  7 10:25:52 CDT 2005 (1)

Sep  7 15:44:32 myth_hostname ntpd[7374]: precision = 1.000 usec

Sep  7 15:44:32 myth_hostname ntpd[7374]: Listening on interface wildcard, 0.0.0.0#123

Sep  7 15:44:32 myth_hostname ntpd[7374]: Listening on interface lo, 127.0.0.1#123

Sep  7 15:44:32 myth_hostname ntpd[7374]: Listening on interface ra0, 192.168.1.101#123

Sep  7 15:44:32 myth_hostname ntpd[7374]: kernel time sync status 0040

Sep  7 15:44:33 myth_hostname ntpd[7374]: Frequency format error in /var/lib/ntp/ntp.drift

Sep  7 15:48:51 myth_hostname ntpd[7374]: synchronized to 128.105.39.11, stratum 3

myth_hostname ~ # ntpq -c pe

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

*caesar.cs.wisc. 128.105.201.11   3 u   60   64   37   10.705   -5.915   1.572

+zoroaster.sf-ba 128.252.19.1     2 u   58   64   37   91.476   22.646 141.896

+dr-zaius.cs.wis 128.105.201.11   3 u   57   64   37   10.286   -7.783   2.197

myth_hostname ~ # ntpq -c rv

assID=0 status=c624 sync_alarm, sync_ntp, 2 events, event_peer/strat_chg,

version="ntpd 4.2.0a@1.1191-r Wed Sep  7 10:25:52 CDT 2005 (1)"?,

processor="i686", system="Linux/2.6.13-gentoo", leap=11, stratum=16,

precision=-20, rootdelay=0.000, rootdispersion=4.905, peer=55844,

refid=INIT, reftime=00000000.00000000  Thu, Feb  7 2036  0:28:16.000,

poll=6, clock=0xc6c9d0f8.ae6e008e, state=3, offset=-5.915,

frequency=0.000, noise=2.957, jitter=1.823, stability=0.000

myth_hostname ~ #

----------

## thesnowman

I don't know how to fix your problem, but I recommend the use of openntpd.  I've been using it for a few months now and haven't had any problems with it.  I found the default ntp client and server weren't keeping my time synced correctly.  I also liked the description in portage. i.e. lightweight

```
# emerge -aC ntp

# emerge -av openntpd
```

----------

## Jerry Gardner

Delete the drift file and let NTP recreate it.

----------

## sumerian

The problem with openntpd is that it doesn't have ntpq, which is a great tool for manually querying servers, and you can't install ntp and openntpd at the same time unless you hack the ebuilds.

----------

## PaulBredbury

See the howto - OpenNTPD has the disadvantage that it does not cater for drift, so NTP is the better choice.

----------

## tundish

Hi, Badgers, did you fix this in the end?

I'm setting up NTP too and I'm having a similar problem. My box is talking to the time servers but still thinks it's Stratum 16.

I found some tips here: http://ntp.isc.org/bin/view/Support/KnownOsIssues#Section_9.2.3.

Having grepped my .config, I see my (2.6.13-gentoo-r3) kernel is configured for HZ=250. So, I'm going to recompile it for 100.

Does anyone know what impact this may have? How does performance suffer? Am I going to break stuff?   :Confused: 

Cheers

----------

## badgers

I think so, I completly ignored it.

I have not seen any more errors in the /var/log/messages

It seems that the error may not have been a big issue as it seems ntpd has re-written it.

I let it run for a few weeks and the clock was in-sync enough for what I wanted.

I have always been facinated by people who are concerned that their clock is 1 second off.

For me +/- 15 sec is close enough.

HTH

----------

## newtonian

Thanks, 

My subversion servers' time drifted several hours off.

It caused all kinds of havoc.  I didn't notice this error 

in /var/log/ until it was too late.

deleting  /var/lib/ntp/ntp.drift  fixed the problem.

Now my stratum is up to 6.

Cheers,

----------

## fuoco

For just a laptop - what is better to run ? ntpd or openntpd ?

----------

## PaulBredbury

 *fuoco wrote:*   

> For just a laptop - what is better to run ? ntpd or openntpd ?

 

Being on a laptop makes no difference to the choice. See my comment above.

----------

## fuoco

I just can't seem to be able to load the wiki pages for some reason. I see there's also chrony - which appears to be doing the same thing ?

----------

## PaulBredbury

The wiki is currently down, but you can use the Google cache.

I haven't tried chrony.

----------

