gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] default port?


From: Florian Petry
Subject: Re: [gpsd-users] default port?
Date: Mon, 9 May 2016 06:46:44 +0000

Hello,

I had the same problem about one week ago and it cost me some hours to figure 
it out.
In Raspbian Jessie system ist 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/system/system/ and 
edit it there (has higher priority and will be used) or to create a 
SERVICENAME.d folder in /lib/system/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 Ben Barker
> Gesendet: Sonntag, 8. Mai 2016 23:28
> An: address@hidden
> Betreff: [gpsd-users] default port?
>
> Apologies for what I am almost certain must be a very simple query, but I
> have not yet managed to find a solution...
>
>
> I have gpsd tunning on a raspberryPi, which itself is running raspBian Jessie
>
>
> All seems fine, but I am struggling to chage the port on which gpsd listens
>
>
> From the command line I can dfo this fine, using:
>
>
> gpsd -N -S <port>
>
>
> However, when starting  as a daemon the port is always 2947
>
>
> I have tried adding:
>
> GPSD_OPTIONS="-S xxxx"
>
>
> To the file /etc/default/gpsd
>
>
> But this does not seem to have any effect. The value set here makes its way
> to the init.d script, but the daemon still listens on its default port.
>
>
> What am I missing?
>
>


—

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]