gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] Refactor the way NTP shared memory segments are addressed


From: Gary E. Miller
Subject: Re: [gpsd-dev] Refactor the way NTP shared memory segments are addressed.
Date: Wed, 14 Jan 2015 11:59:32 -0800

Yo Harlan!

On Wed, 14 Jan 2015 08:00:12 +0000
Harlan Stenn <address@hidden> wrote:

> "Gary E. Miller" writes:
> > Yo Michael!
> > 
> > On Wed, 14 Jan 2015 10:44:14 +0400
> > Michael Tatarinov <address@hidden> wrote:
> > 
> > > It's already in stable (4.2.8p1-beta3)
> > 
> > A beta3 is stable?  Weird...
> 
> It was the beta for the pending 4.2.8p1 release.

Any chance to get another tweak in first?
 
> > > and new behavior is documented.
> > 
> > Where?
> 
> html/drivers/driver28.html

Did I miss the definition of the defaults?  Do segments 0 and 1 still
default to 600 and 2 and 3 still default to 666?   If not an upgrade 
might break existing setups.

The doc seems a bit inconsistent:

"NTPD is started as root on most POSIX-like operating systems and uses
the setuid/setgid system API to run under reduced rights once the
initial setup of the process is done.  One consequence out of this is
that the allocation of SHM segments must be done early during the clock
setup."

That seems odd.  I thought the point of the change was so that the
segment could be done after dropping root?

> > > Now all shm segments must be perms 600.
> > 
> > The bug implied this was selectable in the ntp.conf?
> 
> "This driver receives its reference clock info from a shared
> memory-segment. The shared memory-segment is created with owner-only
> access by default, unless otherwise requested by the mode word for
> units
> >= 2. Units 0 and 1 are always created with owner-only access for
> backward compatibility."

So this is an incompatible change?  0 and 1 no longer owned by root?

This is problematic for gpsd.  If gpsd starts first, and thus creates
the shared segments, how is it to know the owner/perms?  Maybe gpsd
now will always need to start after ntpd starts?  And run as the same
user?

> The owner-only access segments are 0600, while the public access
> segments are 0666.

Might it be better if the 'owner only' ran as 660?  Then gpsd
would not need to run as the same user as ntpd, only as the same group.
 
> > Any guidance as to which user?
> 
> Whatever you can tell ntpd and gpsd to run as.

And when you do not that is still root?
 
> > That means that gpsd and ntpd must run as the same user?  Many will
> > not like that.
> 
> Then run with a "unit" >=2 and use a public segment.  That will
> present other problems.  I can see somebody deciding that 0660 is a
> good choice at some time.

Yes, but how does the present scheme allow for that?
 
> As an aside, we do have driver46.html now, which uses a JSON socket to
> handle the communications between ntpd and gpsd.

Interesting.  I'll have to try that, but I am pretty sure PPS does not
work over JSON.

I see this:

"The driver uses the error estimations (95% probability limits) provided
by GPSD to set the clock precision dynamically according to these
readings. "

gpsd has not sent time quality estimates in a long time since ntpd was
not using them.  Do you instead use the DOP to guess time quality?  Not
a good idea.

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



reply via email to

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