gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] GPSD and systemd


From: Charles Curley
Subject: [gpsd-users] GPSD and systemd
Date: Tue, 7 Mar 2017 17:32:25 -0700

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>

-- 

The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no Warrants shall issue, but upon probable cause,
supported by Oath or affirmation, and particularly describing the
place to be searched, and the persons or things to be seized.
-- U.S. Const. Amendment IV

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB



reply via email to

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