[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] GPSD and systemd
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-users] GPSD and systemd |
Date: |
Tue, 7 Mar 2017 16:43:38 -0800 |
Yo Charles!
Great stuff! Prolly needs to be added to git head somehow.
On Tue, 7 Mar 2017 17:32:25 -0700
Charles Curley <address@hidden> wrote:
> Some notes on systemd as it applies to gpsd. Some folks don't like
> gpsd, and that's fine. This is for those who are obliged to live with
> it. It is an effort to consolidate several years of wisdom on the
> gpsd email list.
>
> All of this is on debian 8.7 (jessie).
>
> I am no expert on systemd! This is the result of reading several email
> threads on the gpsd list, the systemd docs, and some
> experimentation. I welcome improvements and corrections.
>
> 1. To customize configurations on systemd, copy the application's
> file(s) from /lib/systemd/system to /etc/systemd/system, and edit
> the new copy. This over-rides the /lib/systemd/system
> original. Doing it this way should preserve your changes against
> upgrades to the /lib/systemd/system originals.
>
> To make your changes effective, run "systemctl daemon-reload", and
> keep an eye on your log file (/var/log/syslog on Debian) for
> errors.
>
> 2. The -G option to gpsd is useless without editing gpsd.socket. This
> is what I have:
>
> --------------------------------------------------
> [Unit]
> Description=GPS (Global Positioning System) Daemon Sockets
>
> [Socket]
> ListenStream=/var/run/gpsd.sock
> ListenStream=[::]:2947
> ListenStream=0.0.0.0:2947
> SocketMode=0600
> BindIPv6Only=ipv6-only
>
> [Install]
> WantedBy=sockets.target
> --------------------------------------------------
>
> I believe you must have the BindIPv6Only=ipv6-only line. I omitted
> it, and got error messages. They went away when I added it. It may
> be that you can use the IPV6 line only, and you will still get gpsd
> on the IPV4 port. I did not experiment with that.
>
> Thanks to Florian Petry <address@hidden>, and "David J
> Taylor" <address@hidden> for leading the way.
>
> 3. Starting and stopping gpsd is problematic with the default
> gpsd.service. Mine looks like so:
>
> --------------------------------------------------
> [Unit]
> Description=GPS (Global Positioning System) Daemon
> Requires=gpsd.socket
> # Needed with chrony SOCK refclock
> After=chronyd.service
>
> [Service]
> Type=forking
> # PIDfile=/var/run/gpsd.pid
> # EnvironmentFile=-/etc/default/gpsd
> ExecStart=/usr/local/sbin/gpsd -G /dev/ttyUSB0
>
> [Install]
> WantedBy=multi-user.target
> Also=gpsd.socket
> --------------------------------------------------
>
> Once you have this you can use service to control gpsd ("service
> gpsd start", etc.) and various systemd tools.
>
> This gets rid of /etc/default/gpsd entirely, a good thing.
>
> Thanks to Moe <address@hidden>, Bernd Zeimetz <address@hidden> (our
> Debian maintainer), and Bryan Christianson <address@hidden>
>
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
pgpys9XiHIaQV.pgp
Description: OpenPGP digital signature