Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 1996 16:11:22 -0300
From:      Harlan Stenn <Harlan.Stenn@pfcs.com>
To:        sthaug@nethelp.no
Cc:        bde@zeta.org.au, current@freebsd.org
Subject:   Re: xntpd stepping clock backwards? (was: Re: NFSv3 fixes for review) 
Message-ID:  <108.837461482@mumps.pfcs.com>
In-Reply-To: sthaug@nethelp.no's message dated Mon, 15 Jul 1996 14:28:34.  <20426.837433714@verdi.nethelp.no> 

next in thread | previous in thread | raw e-mail | index | archive | help
How stable is the reference you're syncing with?  If it's not being
stable, that's one possibilty.

More likely is that the clock in your machine is a bit off.  How big is
the drift value in /etc/ntp.drift (check for the "driftfile /wherever" line
in ntp.conf)?  The first number should be between -105.xxx and 105.xxx.
If it's not, you'll need to run tickadj -t <something> (once when you
decide to change it, and at boot time).

Here's a script I've used that usually does the right thing.  Note that
if you change the "base" value of tick using "tickadj -t <something>"
then this script will show you the size and amount of change, not the
actual value to put in.

H

#! /usr/bin/perl
#
# drift of 104.8576 -> -1 tick.  Base  of 10000 ticks.
#
$df="/etc/ntp.drift";
$base=10000;
$cvt=104.8576;
$v1=0.;
$v2=0;

if (open(DF, $df))
  {
    if ($_=<DF>)
      {
        ($v1, $v2) = split;
      }

    while ($v1 gt $cvt)
      {
        $v1 -= $cvt;
        $base--;
      }

    while ($v1 lt 0)
      {
        $v1 += $cvt;
        $base++;
      }
  }

printf("%.3f %d\n", $v1,$v2);

print("$base\n");




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?108.837461482>