Re: NTP change (was Re: Schedule for Wednesday's FESCo Meeting (2021-01-06))

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

 



Once upon a time, Miroslav Lichvar <mlichvar@xxxxxxxxxx> said:
> On Tue, Jan 05, 2021 at 08:30:39AM -0600, Chris Adams wrote:
> > Once upon a time, Zbigniew Jędrzejewski-Szmek <zbyszek@xxxxxxxxx> said:
> > > #2517 F34 Change: ntp replacement
> > > https://pagure.io/fesco/issue/2517
> > > APPROVED (+5, 0, 0)
> >
> > I changed my stratum 1 server from ntpd to chronyd+ntp-refclock... had a
> > few small bumps to figure out (getting the NTP, PPS, and chrony services
> > correct), but it is working.
> 
> If the bumps were due to insufficient documentation (e.g. the
> ntp-refclock man page), would you have any suggestions on how to
> improve it, or submit a patch?

Since I'm using a refclock that doesn't handle PPS, I have chronyd
configured to use /dev/pps0.  In that case, the example systemd unit in
the ntp-refclock man page can't work, because chronyd expects /dev/pps0
to exist when it starts (or it'll just exit).  The ordering has to be
PPS setup, then chronyd, then ntp-refclock.

I did this by making a separate service for PPS, pps-setup@.service:

*****
[Unit]
Description=PPS serial setup
Before=chronyd.service

[Service]
Restart=on-failure
ExecStartPre=/usr/bin/setserial /dev/%I low_latency
ExecStart=/sbin/ldattach -d 18 /dev/%I

[Install]
WantedBy=multi-user.target
*****

then these udev rules for my device (USB serial adapter for the data
stream, ttyS0 for the PPS ticks):

*****
# - TSIP serial stream over USB
KERNEL=="ttyUSB*", ATTRS{interface}=="DLP2232M", ATTRS{bInterfaceNumber}=="01", SYMLINK+="palisade0", MODE:="0660", GROUP:="ntp-refclock", RUN+="/usr/bin/chcon -t clock_device_t /dev/$name"
# - PPS over serial
SUBSYSTEM=="pps", MODE:="0660", GROUP:="chrony"
KERNEL=="ttyS0", TAG+="systemd", ENV{SYSTEMD_WANTS}="pps-setup@%k.service"
*****

and this service for ntp-refclock:

*****
[Unit]
Description=GPS Resolution clock
After=chronyd.service
BindsTo=chronyd.service

[Service]
ExecStart=/usr/sbin/ntp-refclock -s /var/run/chrony-GPS.sock 127.127.29.0 mode 5 time1 0.060 flag2 1
RestartOn=failure
RestartSec=5s

[Install]
WantedBy=multi-user.target
*****

It would be nicer if ntp-refclock just included the systemd unit and
used a config to get the options (e.g. /etc/sysconfig/ntp-refclock), and
maybe even the PPS setup unit.  Obviously the udev rules are device
specific, but it might be good to include an example in the docs
directory.

> > It might be useful for others to document how I have it working - where
> > would be a good place for that?  Submit a README example or something?
> 
> Is it meant to be a description of an alternative to switching to
> ntpsec wrt to the ntp retirement? Fedora-specific information can be
> included in the package's documentation, but I'm not sure how many
> people will look for that. Generally applicable information would be
> best upstream.

ntpsec either has or plans to drop the refclock I use.  I picked up a
used Trimble Resolution T a while back, and running it in TSIP mode
works better than NMEA mode, but uses the Palisade refclock.  It works
fine, but it seems the ntpsec goal is to support as little as possible.

> If you didn't use gpsd because you hit a bug there, it would be nice
> to send a bugreport upstream. A debug output (-D 9 option) might be
> enough to get it fixed.

Last I looked, gpsd operates Trimble TSIP devices differently than the
ntpd refclock code.  The Resolution T is designed to be a timing device,
assuming it's in a fixed position, and the ntpd Palisade refclock code
puts it in "0-D" mode to support that.  Once it gets a position fix, it
can tick accurate time with only a single satellite lock (which is nice
for my setup since I don't have the best antenna position).

Since gpsd is designed first for positioning, it sets TSIP devices to a
regular "3-D" mode, where they'll stop ticking if they don't have an
active position fix (at least 3 satellites in view).  That makes sense
and I wouldn't call it a bug in gpsd.

-- 
Chris Adams <linux@xxxxxxxxxxx>
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux