mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-12-22 18:52:45 +01:00
gpsd.service.d: create a socket for geoclue, add comments
This commit is contained in:
parent
af1f376f18
commit
8b3247df17
@ -1,10 +1,25 @@
|
||||
# As usual this is a systemd drop-in, so I can adjust what gpsd.service does
|
||||
# without having to fight with package management.
|
||||
[Service]
|
||||
Type=exec
|
||||
# In case the file exists, I can throw my own additional options there
|
||||
EnvironmentFile=-/etc/gpsd.aminda.conf
|
||||
ExecStart=
|
||||
# PRIVACY WARNING! --listenany happily allows anyone to ask where the host is
|
||||
# Kernel module possibly required for USB GPS devices especially with Chrony?
|
||||
ExecStartPre=-/usr/sbin/modprobe pps_ldisc
|
||||
ExecStart=/usr/sbin/gpsd /dev/gps0 --listenany --nowait --foreground $AMINDAGPSD
|
||||
# Handle failure situation of the socket not going away (ExecStartPost=)
|
||||
ExecStartPre=-/usr/bin/rm -vf /var/run/gpsd-nmea.sock
|
||||
# Empty ExecStart= before the actual ExecStart= removes the original
|
||||
# ExecStart= line
|
||||
ExecStart=
|
||||
ExecStart=/usr/sbin/gpsd /dev/gps0 --nowait --foreground $AMINDAGPSD
|
||||
# Creating a socket for geoclue to connect to
|
||||
# Credit: @schnell at https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/145#note_1772702
|
||||
ExecStartPost=/bin/sh -c "(sleep 5 && gpspipe --nmea | ( read; read; read; cat ) | ncat --verbose --keep-open --listen --unixsock /var/run/gpsd-nmea.sock&)"
|
||||
# In case of clean shutdown, remove the socket for restart
|
||||
ExecStopPost=-/usr/bin/rm -vf /var/run/gpsd-nmea.sock
|
||||
# Missing from the original unit, will reconnect all GPS says man gpsd
|
||||
ExecReload=/usr/bin/killall -HUP gpsd
|
||||
# Avoiding systemd considering the unit as failed.
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
# vim: filetype=systemd
|
||||
|
Loading…
Reference in New Issue
Block a user