Bug 752923

Summary: gpsd hogs my USB serial ports
Product: [Fedora] Fedora Reporter: David Howells <dhowells>
Component: gpsdAssignee: Douglas E. Warner <silfreed>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: mlichvar, silfreed
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-11 12:08:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 752935    

Description David Howells 2011-11-10 19:16:23 UTC
Description of problem:

When the system boots, gpsd opens some of my USB serial ports and doesn't let them go.

I have 6 serial ports that I use for communicating with my test machines:

warthog>lsusb | grep FT232
Bus 002 Device 009: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 010: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 014: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 015: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 023: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 002 Device 024: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

However, they match a rule in /etc/udev/rules.d/99-gpsd.rules and so start up gpsd.

Version-Release number of selected component (if applicable):

gpsd-2.95-6.fc15.x86_64

How reproducible:

100%

Steps to Reproduce:
1.Boot the system

or:

1.Kill gpsd.
2.Unplug and plug back in the USB serial port adapters.

[root@warthog linux-2.6-fscache]# ls -l /proc/29736/fd
total 0
lrwx------. 1 root root 64 Nov 10 19:09 0 -> /dev/null
lrwx------. 1 root root 64 Nov 10 19:09 1 -> /dev/null
lrwx------. 1 root root 64 Nov 10 19:09 10 -> /dev/ttyUSB2
lrwx------. 1 root root 64 Nov 10 19:11 11 -> /dev/ttyUSB0
lrwx------. 1 root root 64 Nov 10 19:11 12 -> /dev/ttyUSB1
lrwx------. 1 root root 64 Nov 10 19:09 2 -> /dev/null
lrwx------. 1 root root 64 Nov 10 19:09 3 -> socket:[21880336]
lrwx------. 1 root root 64 Nov 10 19:09 4 -> socket:[21878807]
lrwx------. 1 root root 64 Nov 10 19:09 5 -> socket:[21878808]
lrwx------. 1 root root 64 Nov 10 19:09 6 -> socket:[21878809]
lrwx------. 1 root root 64 Nov 10 19:09 8 -> /dev/ttyUSB3
lrwx------. 1 root root 64 Nov 10 19:09 9 -> socket:[21849722]

Stracing the daemon shows it's sitting there selecting on them:

[root@warthog linux-2.6-fscache]# strace -p 29736
Process 29736 attached - interrupt to quit
select(13, [3 4 5 8 10 11 12], NULL, NULL, {0, 375590}) = 0 (Timeout)
select(13, [3 4 5 8 10 11 12], NULL, NULL, {1, 0}) = 0 (Timeout)
select(13, [3 4 5 8 10 11 12], NULL, NULL, {1, 0}) = 0 (Timeout)
select(13, [3 4 5 8 10 11 12], NULL, NULL, {1, 0}) = 0 (Timeout)
select(13, [3 4 5 8 10 11 12], NULL, NULL, {1, 0}) = 0 (Timeout)
select(13, [3 4 5 8 10 11 12], NULL, NULL, {1, 0}^C <unfinished ...>

Which indicates another possible bug: why isn't it doing an infinitely long select?


Additionally, querying systemd with "systemctl --all | grep gps" shows:

dev-gps0.device           loaded active   plugged       FT232 USB-Serial (UART) IC
dev-gps1.device           loaded active   plugged       FT232 USB-Serial (UART) IC
dev-gps2.device           loaded active   plugged       FT232 USB-Serial (UART) IC
dev-gps3.device           loaded active   plugged       FT232 USB-Serial (UART) IC
dev-gps4.device           loaded active   plugged       FT232 USB-Serial (UART) IC
dev-gps5.device           loaded active   plugged       FT232 USB-Serial (UART) IC

though I've no idea why that thinks they're GPS ports - presumably something to do with udev.

Comment 1 Miroslav Lichvar 2011-11-11 12:08:27 UTC
It's a udev rule which might be too general.

You'll need to set USBAUTO=true in /etc/sysconfig/gpsd to disable starting gpsd from udev.

*** This bug has been marked as a duplicate of bug 663124 ***