summaryrefslogtreecommitdiff
path: root/gpsd.hotplug
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-03-08 06:29:39 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-03-08 06:29:39 +0000
commitebd128f2dc6143056e270ab604195f08bef77adc (patch)
tree04ab9b5b15390e3a2d6ba5937e005f7f423fdd92 /gpsd.hotplug
parent4d1df35bbac5258733b6f86e9276fd6ff9429380 (diff)
downloadgpsd-ebd128f2dc6143056e270ab604195f08bef77adc.tar.gz
Launch completely from the hotpug script.
Diffstat (limited to 'gpsd.hotplug')
-rwxr-xr-xgpsd.hotplug10
1 files changed, 9 insertions, 1 deletions
diff --git a/gpsd.hotplug b/gpsd.hotplug
index c1be0676..b9b4e810 100755
--- a/gpsd.hotplug
+++ b/gpsd.hotplug
@@ -31,6 +31,7 @@ def gpsd_connect():
syslog.syslog("gpsd is not running or is unreachable")
return None
else:
+ syslog.syslog("found gpsd.")
return sockfile
def wake_up_gpsd(devpath):
@@ -47,6 +48,13 @@ def wake_up_gpsd(devpath):
else:
tty = "/dev/" + subnodes[0]
syslog.syslog(tty + " has gone active")
+ # Cope with a race condition
+ i = 0
+ while not os.path.exists(tty):
+ syslog.syslog("but " + tty + " does not actually exist (" + `i` +")")
+ time.sleep(1)
+ i += 1
+ syslog.syslog(tty + "created")
# Next get a connection to gpsd; start one if not already running
connect = gpsd_connect()
@@ -54,7 +62,7 @@ def wake_up_gpsd(devpath):
syslog.syslog("reached a running gpsd")
else:
syslog.syslog("attempting to launch gpsd")
- os.system("/etc/init.d/gpsd start")
+ os.system("gpsd")
connect = gpsd_connect()
if not connect:
return