From af1f376f18162e9038e8255a9d581787e56ad334 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Thu, 18 Jul 2024 17:14:45 +0300 Subject: [PATCH] {chrony,gpsd}: add working gps sync config --- etc/chrony/conf.d/gps.conf | 4 ++++ etc/systemd/system/gpsd.service.d/aminda-additions.conf | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 etc/chrony/conf.d/gps.conf diff --git a/etc/chrony/conf.d/gps.conf b/etc/chrony/conf.d/gps.conf new file mode 100644 index 00000000..981095ae --- /dev/null +++ b/etc/chrony/conf.d/gps.conf @@ -0,0 +1,4 @@ +refclock SHM 0 poll 3 refid GPS1 +# unlikely to work with usb +refclock SHM 1 refid GPS2 +refclock SOCK /var/run/chrony.ttyUSB0.sock refid SOCK diff --git a/etc/systemd/system/gpsd.service.d/aminda-additions.conf b/etc/systemd/system/gpsd.service.d/aminda-additions.conf index ac51cdf9..bb0bcd17 100644 --- a/etc/systemd/system/gpsd.service.d/aminda-additions.conf +++ b/etc/systemd/system/gpsd.service.d/aminda-additions.conf @@ -1,4 +1,10 @@ [Service] +Type=exec EnvironmentFile=-/etc/gpsd.aminda.conf ExecStart= -ExecStart=/usr/sbin/gpsd --debug 2 --nowait --badtime $GPSD_OPTIONS $OPTIONS $DEVICES $AMINDAGPSD +# PRIVACY WARNING! --listenany happily allows anyone to ask where the host is +ExecStartPre=-/usr/sbin/modprobe pps_ldisc +ExecStart=/usr/sbin/gpsd /dev/gps0 --listenany --nowait --foreground $AMINDAGPSD +ExecReload=/usr/bin/killall -HUP gpsd +Restart=always +RestartSec=5s