gpsd.service.d: use geoclue default socket location for compatibility

This commit is contained in:
Aminda Suomalainen 2024-07-19 07:57:30 +03:00
parent 79f666eb1d
commit a01db66cc1
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

View File

@ -7,16 +7,16 @@ EnvironmentFile=-/etc/gpsd.aminda.conf
# Kernel module possibly required for USB GPS devices especially with Chrony? # Kernel module possibly required for USB GPS devices especially with Chrony?
ExecStartPre=-/usr/sbin/modprobe pps_ldisc ExecStartPre=-/usr/sbin/modprobe pps_ldisc
# Handle failure situation of the socket not going away (ExecStartPost=) # Handle failure situation of the socket not going away (ExecStartPost=)
ExecStartPre=-/usr/bin/rm -vf /var/run/gpsd-nmea.sock ExecStartPre=-/usr/bin/rm -vf /var/run/gps-share.sock
# Empty ExecStart= before the actual ExecStart= removes the original # Empty ExecStart= before the actual ExecStart= removes the original
# ExecStart= line # ExecStart= line
ExecStart= ExecStart=
ExecStart=/usr/sbin/gpsd /dev/gps0 --nowait --foreground $AMINDAGPSD ExecStart=/usr/sbin/gpsd /dev/gps0 --nowait --foreground $AMINDAGPSD
# Creating a socket for geoclue to connect to # Creating a socket for geoclue to connect to
# Credit: @schnell at https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/145#note_1772702 # 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&)" ExecStartPost=/bin/sh -c "(sleep 5 && gpspipe --nmea | ( read; read; read; cat ) | ncat --verbose --keep-open --listen --unixsock /var/run/gps-share.sock&)"
# In case of clean shutdown, remove the socket for restart # In case of clean shutdown, remove the socket for restart
ExecStopPost=-/usr/bin/rm -vf /var/run/gpsd-nmea.sock ExecStopPost=-/usr/bin/rm -vf /var/run/gps-share.sock
# Missing from the original unit, will reconnect all GPS says man gpsd # Missing from the original unit, will reconnect all GPS says man gpsd
ExecReload=/usr/bin/killall -HUP gpsd ExecReload=/usr/bin/killall -HUP gpsd
# Avoiding systemd considering the unit as failed. # Avoiding systemd considering the unit as failed.