gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] A detail in your ntpoffset script


From: Gary E. Miller
Subject: Re: [gpsd-dev] A detail in your ntpoffset script
Date: Tue, 22 Oct 2013 16:05:53 -0700

Yo Andy!

On Tue, 22 Oct 2013 18:24:51 -0400
Andy Walls <address@hidden> wrote:

> A script should really be written that computes the fudge for all the
> individual refclocks present in the file: 127.127.d.u for drivers d,
> units u.

Yeah.

> It would nice if it could skip the first n seconds as well. to throw
> out the startup transient.  The transient values can be very far from
> the stable average.

Yeah, and then delete te old data, so the next run has clean data using
the new fudge.

> You might need perl vs awk for all that.  (gaunlet thrown down :) )

I'd do it in PHP, but Python prolly the winner. :-)

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
        address@hidden  Tel:+1(541)382-8588

> 
> Regards,
> Andy
> 
> address@hidden wrote:
> >awk '
> >     /127\.127\.28\.0/ { sum += $5 * 1000; cnt++; }
> >     END { print sum / cnt; }
> >' </var/log/ntpstats/peerstats
> >
> >Should that be .1 rather than .0?  
> >
> >I'm thinking of this coment in ntpshm.c:
> >
> > * Segments 0 and 1: permissions 0600, i.e. other programs can only
> > *                   read and write as root.
> > *
> > * Segments 2 and 3: permissions 0666, i.e. other programs can read
> > *                   and write as any user.  I.e.: if ntpd has been
> > *                   configured to use these segments, any
> > *                   unpriviliged user is allowed to provide data
> > *                   for synchronisation.
> > *
> > * As gpsd can be started as both root and non-root, this behaviour
> > is
> > * mimicked by:
> > *
> > * Started as root: do as ntpd when attaching (creating) the
> > segments.
> > * (In contrast to ntpd, which only attaches (creates) configured
> > * segments, gpsd creates all segments.)
> > *
> > * Started as non-root: only attach (create) segments 2 and 3 with
> > * permissions 0666.  As the permissions are for any user, the
> > creator
> > * does not matter.
> > *
> > * For each GPS module gpsd controls, it will use the attached ntpshm
> > * segments in pairs (for coarse clock and pps source, respectively)
> > * starting from the first found segments.  I.e. started as root, one
> > * GPS will deliver data on segments 0 and 1, and as non-root data
> > * will be delivered on segments 2 and 3.
> >
> >This seems to imply that the PPS unit is .1 rather than .0.
> >-- 
> >             <a href="http://www.catb.org/~esr/";>Eric S.
> >     Raymond</a>
> >
> >No matter how one approaches the figures, one is forced to the rather
> >startling conclusion that the use of firearms in crime was very much
> >less when there were no controls of any sort and when anyone,
> >convicted criminal or lunatic, could buy any type of firearm without
> >restriction.  Half a century of strict controls on pistols has ended,
> >perversely, with a far greater use of this weapon in crime than ever
> >before.
> >        -- Colin Greenwood, in the study "Firearms Control", 1972
> 



Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]