Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 235855 - sci-geosciences/gpsd-2.37 device reconnection broken by udev rules
Summary: sci-geosciences/gpsd-2.37 device reconnection broken by udev rules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Steve Arnold
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-27 05:37 UTC by Sam Revitch
Modified: 2008-09-08 03:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Revitch 2008-08-27 05:37:36 UTC
The udev rules provided with sci-geosciences/gpsd-2.37 propagate device add events for USB GPS receivers to gpsd, but fail to propagate device remove events.

This can cause reconnection failures on a system with a single GPS receiver that is occasionally removed and re-attached.  If the receiver was initially allocated ttyUSB0, is unplugged, and then replugged before ttyUSB0 becomes available again, the receiver will be attached to ttyUSB1 instead.  The hotplug script will then request gpsd to open ttyUSB1 as a second GPS receiver and gpsd will be configured to monitor two devices -- one of which it will never be able to open.  This prevents gpsd from reattaching listening clients.  Worse, since ttyUSB1 was added more recently, gpsd will favor it for new clients, and if the GPS receiver is subsequently reattached to ttyUSB0, new clients will be unable to use the GPS at all.

I'm not sure what causes ttyUSBX devices to become reusable, but the skew from ttyUSB0 to ttyUSB1 is very easy to reproduce.

Reproducible: Always




These are my replacement udev rules that seem to work:

SUBSYSTEM=="tty", ACTION=="add", KERNEL=="ttyUSB[0-9]*", SYMLINK="gps%n", RUN+="/etc/hotplug/usb/gpsd.hotplug add $root/%k"
SUBSYSTEM=="tty", ACTION=="remove", KERNEL=="ttyUSB[0-9]*", RUN+="/etc/hotplug/usb/gpsd.hotplug remove $root/%k"
Comment 1 Wormo (RETIRED) gentoo-dev 2008-08-27 06:26:57 UTC
Thanks for the proposed fix, assigning to maintainer (hi nerdboy :) )
Comment 2 Steve Arnold archtester gentoo-dev 2008-09-08 03:53:57 UTC
Yeah, the "remove" rules are a good idea.  I integrated them with the current rules, and added the known device IDs.  It works fine with my cheap USB device, but it also does the same thing with (non-GPS) usb-serial converter.  Oh well...

Thanks; now updated and time to see if there's a new version out...