FS#53651 - [gpsd] Problems with service file and GPS devices with PPS
Attached to Project:
Community Packages
Opened by Oscar Garcia (ogarcia) - Wednesday, 12 April 2017, 12:16 GMT
Last edited by Jaroslav Lichtblau (Dragonlord) - Monday, 07 February 2022, 17:33 GMT
Opened by Oscar Garcia (ogarcia) - Wednesday, 12 April 2017, 12:16 GMT
Last edited by Jaroslav Lichtblau (Dragonlord) - Monday, 07 February 2022, 17:33 GMT
|
Details
I found two small issues with this package.
The first one is that in gpsd.service there is a line that says `After=chronyd.service`, this line must be `After=chrony.service` cause in archlinux the chrony unit is chrony.service. I think that this can be fixed with a simple sed in prepare: # fix service sed -i "s/After=chronyd.service/After=chrony.service/" \ systemd/gpsd.service The second one is that if you have a GPS device with PPS, the /dev/pps0 can only be readed by root. If you make package with `gpsd_group=uucp` then gpsd cannot read the ppps device. The posible solutions for this is build package with `gpsd_group=root` or (I don't know if can make this) build kernel module to make /dev/pps0 device be owned by uucp group. |
This task depends upon
Closed by Jaroslav Lichtblau (Dragonlord)
Monday, 07 February 2022, 17:33 GMT
Reason for closing: Won't fix
Additional comments about closing: long time open, 0 votes, seems not to be having such an impact if still present
Monday, 07 February 2022, 17:33 GMT
Reason for closing: Won't fix
Additional comments about closing: long time open, 0 votes, seems not to be having such an impact if still present
Have you tried a udev rule that changes the group of /dev/pps0 to uucp?
$ cat /etc/udev/rules.d/50-gpsd.rules
KERNEL=="pps[0-9]*", GROUP="uucp"
$ ls -l /dev/pps0
crw-rw---- 1 root uucp 243, 0 Apr 13 04:25 /dev/pps0
$ id
uid=1000(ogarcia) gid=1000(ogarcia) groups=1000(ogarcia),10(wheel),14(uucp)
$ ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
cannot set parameters (Operation not permitted)
But with root:
$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1524469971.000791567, sequence: 118 - clear 0.000000000, sequence: 0
source 0 - assert 1524469972.000794652, sequence: 119 - clear 0.000000000, sequence: 0
source 0 - assert 1524469973.000794737, sequence: 120 - clear 0.000000000, sequence: 0
...
http://git.savannah.gnu.org/cgit/gpsd.git/tree/ppscheck.c#n109 should print do not match, they seem to match https://lwn.net/Articles/240153/
The output would indicate the permissions are enough to access the device but not to use iocontrol on it. (possibly needs CAP_SYS_ADMIN)
http://git.savannah.gnu.org/cgit/gpsd.git/tree/gpsd.c#n2118 the current git version shows awareness of the privilege issue and performing required operations before dropping caps.
But with only gpsd latest package (pps-tools is not needed here) if I run gpsmon the PPS label shows nothing, but it I recompile package with gpsd_group=root and run gpsmon the PPS shows info.
Using the default package and fixing permissions to uucp to /dev/pps0:
│14 124 144 37 0 0110 │┌─────────────────────────────────────────────────┐
│15 126 139 35 0 0110 ││TOFF: 0.142412489 PPS: │
└────── NAV_SVINFO ────────┘└─────────────────────────────────────────────────┘
Using a rebuilded version with gpsd_group=root:
│14 124 144 37 0 0110 │┌─────────────────────────────────────────────────┐
│15 126 139 35 0 0110 ││TOFF: 0.154153138 PPS: 0.000001209 │
└────── NAV_SVINFO ────────┘└─────────────────────────────────────────────────┘
Your tests show an obvious difference between root and none root use so something is being restricted.
http://www.catb.org/gpsd/faq.html#support
http://www.catb.org/gpsd/faq.html#bug-reporting