gpsd depends on nonexistent /lib/udev/hotplug.functions

Bug #367197 reported by PhilDubach
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gpsd (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: gpsd

When plugging in a USB GPS receiver (GlobalSat ND-100 in my case), udev tries to add the device to the running gpsd (assuming gpsd is correctly configured, see below).

The script executed by udev is /lib/udev/gpsd.hotplug.wrapper. This script depends on /lib/udev/hotplug.functions, which is not installed on my system. Hotplugging therefore does not work.
After a quick workaround (comment out the sourcing of hotplug.functions and the calls to 'wait_for_file') hotplugging works perfectly, at least as long as the system is up and running when the device gets plugged in.

Is there a replacement for /lib/udev/hotplug.functions, or does the gpsd package not list all dependencies?

Steps to reproduce:
Note that in order for gpsd.hotplug.wrapper to work at all, one needs to 'dpkg-reconfigure gpsd', and have it start the daemon at boot, specify no device to use, let it use USB devices automatically and specify a control socket in the options to gpsd: '-F /var/run/gpsd.sock'. The control socket path is hardcoded in the hotplug script (/lib/udev/gpsd.hotplug). After dpkg-reconfigure, /etc/defaults/gpsd should have the following settings:
  START_DAEMON="true"
  DAEMON_OPTS="-F /var/run/gpsd.sock"
  DEVICES=""
  USBAUTO="true"

See also: Bug #112494 reports the same problem (among others) and is marked as fixed. I still see the problem on Ubuntu 9.04 (Jaunty) with gpsd 2.38-1ubuntu3

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
Package: gpsd 2.38-1ubuntu3 [modified: lib/udev/gpsd.hotplug.wrapper]
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gpsd
Uname: Linux 2.6.28-11-generic i686

Related branches

Revision history for this message
PhilDubach (phildubach) wrote :
Revision history for this message
Mark O (mark.o) wrote :

I have confirmed this on Jaunty, and have also copied /lib/udev/hotplug.functions from the udev package in Debian sid (0.141-1) instead of commenting it out. I have tested this and found it plays well with hotplug on startup for Jaunty. Let me know if I can help with further testing on this.

Revision history for this message
Bernd Zeimetz (bzed) wrote : Re: [Bug 367197] Re: gpsd depends on nonexistent /lib/udev/hotplug.functions

Mark O wrote:
> I have confirmed this on Jaunty, and have also copied
> /lib/udev/hotplug.functions from the udev package in Debian sid
> (0.141-1) instead of commenting it out. I have tested this and found it
> plays well with hotplug on startup for Jaunty. Let me know if I can help
> with further testing on this.
>

I'm wondering if Ubuntu moved that function to somewhere else, or renamed it, or
if there's a replacement for it... if you could figure that out, I'll take care
that it is used properly. Too bad that Ubuntu always needs to make a mess and
diverge from the rest of the world :|

--
 Bernd Zeimetz Debian GNU/Linux Developer
 GPG Fingerprint: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79

Revision history for this message
Mark O (mark.o) wrote :

Bernd Zeimetz wrote:
> I'm wondering if Ubuntu moved that function to somewhere else, or renamed it, or
> if there's a replacement for it... if you could figure that out, I'll take care
> that it is used properly.
I had done some searching but was unable to find it. I did find references to other packages that were using it too, and first thought it was just an omission from the *buntu udev package. Now just found reference to a commit to the gpsd repository to overcome the problem [Gpsd-commit-watch] r5147 - trunk:
https://lists.berlios.de/pipermail/gpsd-commit-watch/2009-February/001966.html

Revision history for this message
Bernd Zeimetz (bzed) wrote :

Why does Ubuntu always break working things....

Revision history for this message
Mark O (mark.o) wrote :

Not sure what Ubuntu "did" to break this - looks more to me like udev removed a function that gpsd and others were depending on. Perhaps the dependencies weren't specified or tested well enough.

Anyway, 'nuff on finding blame, how best to fix? (I'm new to this). The patch submitted by ESR (to put the wait_for_fille function into gpsd.hotplug.wrapper directly) looks to me like a reasonable approach - is this the sort of thing that a patch can be issued for until the fix flows down from upstream?

This was reported by Phil Dubach, I've confirmed it on two of my systems (both 9.04, one UNR, one kubuntu) and also had this issue on my 8.10 xubuntu though I applied a hack at the time to get around it. At what point does someone update this bug status to confirmed , and how can I help to move this forward?

OK, Just looked on the wiki and find that one of the steps before confirming a bug is to check for duplicates. This report seems to overlap with #112494 (https://bugs.launchpad.net/bugs/112494) but that's from way back so I'm not sure if standard practice says its OK to have duplicates from vastly different versions?

Revision history for this message
Bernd Zeimetz (bzed) wrote :

Mark O wrote:
> Not sure what Ubuntu "did" to break this - looks more to me like udev
> removed a function that gpsd and others were depending on. Perhaps the
> dependencies weren't specified or tested well enough.

The problem is that Ubuntu pulls packages from Debian without testing them. gpsd
works well in Debian, udev still includes the mentioned function, while it was
removed in Ubuntu in udev version 141. So All I can do is to blame Ubuntu. If
they change stuff which breaks packages they autosync (or even touch to "fix"
other things), they need to handle these changes in all packages. Otherwise they
should just take the versions from Debian.

> Anyway, 'nuff on finding blame, how best to fix? (I'm new to this). The

gpsd will be autosynced from Debian again very soon, and I'll upload a package
with that fix within the next days, so it will be taken care of soon. Not sure
why I'm always wasting my time to work around Ubuntu weirdness.

--
 Bernd Zeimetz Debian GNU/Linux Developer
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F

Revision history for this message
Mark O (mark.o) wrote :

Thanks Bernd, appreciate the explanation (and your help).
Regards,
Mark

Revision history for this message
Alessio Treglia (quadrispro) wrote :

Latest version available in karmic should fix this, can you confirm that?

Changed in gpsd (Ubuntu):
status: New → Incomplete
Revision history for this message
Bernd Zeimetz (bzed) wrote :

Alessio Treglia wrote:
> Latest version available in karmic should fix this, can you confirm
> that?

Could you *PLEASE* tell me why you release just another Ubuntu version of gpsd,
although I've included all Ubuntu related changes? If you don't understand what
I did, feel free to ask or leave the package alone. Please get gpsd back to
autosync asap. Then you'll get the fix for this bug for free.

--
 Bernd Zeimetz Debian GNU/Linux Developer
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F

Revision history for this message
Mark O (mark.o) wrote : Re: [Bug 367197] Re: gpsd depends on nonexistent /lib/udev/hotplug.functions

> Latest version available in karmic should fix this, can you confirm
> that?
version in karmic archive (gpsd_2.39-1ubuntu1_i386.deb) still
references hotplug.functions. Should I be looking somewhere else?

Revision history for this message
Bernd Zeimetz (bzed) wrote : Re: [Bug 367197] Re: gpsd depends on nonexistent /lib/udev/hotplug.functions

Mark O wrote:
>> Latest version available in karmic should fix this, can you confirm
>> that?
> version in karmic archive (gpsd_2.39-1ubuntu1_i386.deb) still
> references hotplug.functions. Should I be looking somewhere else?

No. The person who asked the question just did not read what I wrote before...

--
 Bernd Zeimetz Debian GNU/Linux Developer
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F

Revision history for this message
ceg (ceg) wrote :

When this bug is a regression from changes made to udev, is full on in 9.04 and needs syncing from the well and completely maintainded debian package, how can it be marked incomplete?

Changed in gpsd (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
ceg (ceg) wrote :

Why is the hotplug mechanism disabled by default in ubuntu?
As everything is hotplug enabled it seem gps devices are expected to be hotplugable too.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gpsd - 2.39-2

---------------
gpsd (2.39-2) unstable; urgency=low

  * [765fde7b] Calculate soname and library version properly.
  * [1da6bffd] Support the "status" action in the init.d script.
    (Closes: #528688) - thanks to Peter Eisentraut
  * [634d40b0] Make gpsd.hotplug.wrapper work with Ubuntu. (LP: #367197)
  * [1a66eb21] Start gpsd after bluetooth. (LP: #359352)
  * [1e5ffb92] Adding patch to fix a crash in libgpsmm.
  * [ba4e66a1] Updating symbols file after fixing libgpsmm.

 -- Luca Falavigna <email address hidden> Mon, 22 Jun 2009 15:53:32 +0100

Changed in gpsd (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Noel J. Bergman (noeljb) wrote :

It appears that the hotplug extension will be included in Maverick. See bug 625110.

Revision history for this message
Bernd Zeimetz (bzed) wrote :

No need for it any more, the code was ripped out.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.