gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] gpsd / systemd bug?


From: Florian Petry
Subject: Re: [gpsd-users] gpsd / systemd bug?
Date: Wed, 26 Oct 2016 05:55:02 +0000

Hello,

some time ago there was a similar topic on the list and I wrote a short 
description of my setup here. I include it below. Even if system is not 
supported by gpsd it works flawlessly when properly configured.

I'm not using the -G option anymore, as with system setting up the ports they 
are opened to the outside.

The options are then still given through /etc/default/gpsd



=======================================
Hello,

I had the same problem about one week ago and it cost me some hours to figure 
it out.
In Raspbian Jessie systemd is used as init system. In systemd a mechanism 
called "socket-activation" is used to provide parallel start of services 
(http://0pointer.de/blog/projects/socket-activation.html).
As not the service itself is setting up the sockets but system, you have to set 
the port in the gpsd.socket unit (/lib/system/system/gpsd.socket).

The correct way for this is to either copy the file to /etc/systemd/system/ and 
edit it there (has higher priority and will be used) or to create a 
SERVICENAME.d folder in /lib/systemd/system/ and overwrite just the relevant 
values (https://www.freedesktop.org/software/systemd/man/systemd.unit.html).

In the socket file itself you can specify a listening address and port for IPv4 
and IPv6. There's the next pitfall: If you specify both on the same port, the 
IPv4 one will fail, because configuring IPv6 implicitly also configures IPv4. 
This is controlled by the "BinIPv6Only" option.

My config (I went the /etc/... new file way) looks as follows:

===================
[Unit]
Description=GPS (Global Positioning System) Daemon Sockets

[Socket]
ListenStream=/var/run/gpsd.sock
ListenStream=[::]:3333
ListenStream=0.0.0.0:3333
SocketMode=0600
BindIPv6Only=ipv6-only

[Install]
WantedBy=sockets.target
===================


Apparently the proper way would be to just set the IPv6 address and port and 
leave the option as it is as follows:

===================
[Unit]
Description=GPS (Global Positioning System) Daemon Sockets

[Socket]
ListenStream=/var/run/gpsd.sock
ListenStream=[::]:3333
SocketMode=0600

[Install]
WantedBy=sockets.target
===================



Regards
Florian Petry


> -----Ursprüngliche Nachricht-----
> Von: gpsd-users [mailto:gpsd-users-
> address@hidden Im Auftrag von Carl Sutton
> Gesendet: Dienstag, 25. Oktober 2016 22:47
> An: gpsd-users <address@hidden>
> Betreff: Re: [gpsd-users] gpsd / systemd bug?
>
>       You should be able to run it with something like pm2 (process
> manager - http://pm2.keymetrics.io/). This will start the process and watch it
> so that if it crashes it will be restarted.
>
>       Easy to stick it in the start up script, again pm2 has the following:
>
>       pm2 startup
>
>       Which will figure out your system and do what is needed
>
>       It says "for nodejs" but it can run anything.
>
>
>       Carl Sutton
>       dogmatic69.com <http://dogmatic69.com>
>
>       On 25 October 2016 at 18:54, Gary E. Miller <address@hidden
> <mailto:address@hidden> > wrote:
>
>
>               Yo Peter!
>
>               On Tue, 25 Oct 2016 18:00:38 +0100
>               Peter Collard <address@hidden
> <mailto:address@hidden> > wrote:
>
>               > On a Raspberry pi the -G flag has no effect when using
> 'service' eg:
>               > sudo service gpsd start
>
>               gpsd does not really support systemd.  We recommend that
> gpsd
>               be started on boot and left running if possible,
>
>               I don't run systemd on any of my dozens of hosts, hopefully
> someone
>               else here does and can help.
>
>               Where did you get the systemd unit file you are running?
>
>               RGDS
>               GARY
>               
> ---------------------------------------------------------------------------
>               Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend,
> OR 97703
>                       address@hidden <mailto:address@hidden>   Tel:+1 541
> 382 8588 <tel:%2B1%20541%20382%208588>
>
>
>


—

ingenieur
wissenschaften
htw saar

Hochschule für Technik und Wirtschaft des Saarlandes
University of Applied Sciences

Fakultät für Ingenieurwissenschaften
School of Engineering

Florian Petry, M.Sc.
Forschungsgruppe Verkehrstelematik (FGVT)

InnovationsCampus Saar
Altenkesseler Strasse 17/D2
66115 Saarbruecken
Germany

+49 681 5867-648
address@hidden
http://www.htwsaar.de
https://fgvt.htwsaar.de


reply via email to

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