From: Bernd Zeimetz <bernd@bzed.de>
Date: Thu, 5 Aug 2010 00:48:24 +0200
Subject: [PATCH] Do not wait for mountpoints in hotplug wrapper.

Udev does not fork, so waiting for mountpoints to appear at boot time
will block the boot process until we run into the timeout. A proper
implementation would be to fork a process to wait in the background
or to handle the not-yet-added devices in the gpsd init script.
So this is more a quick fix then the proper solution.

See http://bugs.debian.org/591324 for details.
---
 gpsd.hotplug.wrapper |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/gpsd.hotplug.wrapper b/gpsd.hotplug.wrapper
index 8aee7e7..325fca9 100644
--- a/gpsd.hotplug.wrapper
+++ b/gpsd.hotplug.wrapper
@@ -27,21 +27,7 @@ if [ "$ACTION" = "remove" ] ; then
   exit 0
 fi
 
-# This was formerly in /lib/udev/hotplug.functions
-wait_for_file() {
-    [ -e "$1" ] && return 0
-    local count=0
-    while sleep 1; do
-        count=$(( $count + 1 ))
-         [ -e "$1" ] && return 0
-        if [ $count -gt 60 ]; then
-            return 1
-        fi
-    done
-}
-
-# wait for /usr & /var to be mounted
-wait_for_file /usr/bin/python && \
-wait_for_file /var/run && \
+if [ -S ${GPSD_SOCKET} -a -x /usr/bin/python ]; then
   exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
+fi
 
-- 
