LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   [solved] udev rule not starting gpsd during boot (https://www.linuxquestions.org/questions/slackware-14/%5Bsolved%5D-udev-rule-not-starting-gpsd-during-boot-883311/)

xj25vm 05-29-2011 05:25 AM

[solved] udev rule not starting gpsd during boot
 
I'm trying to configure gpsd 2.96 to start automatically from udev rule on a Slack 13.37 box.

1. I've compiled and installed gpsd from sources and made sure it starts manually.
2. I've copied the /lib/udev/gpsd.hotplug and /lib/udev/gpsd.hotplug.wrapper scripts in their places from the source tree and made them executable.
3. I've copied the gpsd.rules file from sources into /etc/udev/rules.d
4. I renamed it 99-persistent-gpsd.rules to run late in the bootup process.
5. I've copied the /etc/default/gpsd file from sources and made sure it has the right settings inside.

Now, for the results. If I plug the gps usb dongle in while the system runs, it starts gpsd if it is not started, and it connects to it just as it should. But if I start the system with the dongle in, gpsd doesn't get started during boot. I can't find any relevant message in /var/log/syslog or /var/log/messages for boot time. There is stuff there from when I plug the dongle in while the system is running though. It's like udev ignores the rules for it at boot time.

Is there something in the Slackware boot scripts that would prevent running those scripts (/lib/udev/gpsd.hotplug.wrapper which in turn runs /lib/udev/gpsd.hotplug which is a Python script)?



Here is the contents of 99-persistent-gpsd.rules (ignore the comments referring to Debian, it was meant for a Debian box). My usb gps adapter is the first one - the Prolific chipset one:


Code:

# udev rules for gpsd
# $Id: gpsd.rules 5861 2009-08-03 13:41:01Z bzed $
#
# GPSes don't have their own USB device class.  They're serial-over-USB
# devices, so what you see is actually the ID of the serial-over-USB chip.
# Fortunately, just two of these account for over 80% of consumer-grade
# GPS sensors.  The gpsd.hotplug.wrapper script will tell a running gpsd
# that it should look at the device that just went active, because it
# might be a GPS.
#
# The following setup works on Debian - something similar will apply on
# other distributions:
#
#  /etc/udev/gpsd.rules
#  /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules
#  /lib/udev/gpsd.hotplug.wrapper
#  /lib/udev/gpsd.hotplug
#
# Setting the link in /etc/udev/rules.d activates the rule and determines
# when to run it on boot (similar to init.d processing).

SUBSYSTEM!="tty", GOTO="gpsd_rules_end"

# Prolific Technology, Inc. PL2303 Serial Port
SYSFS{idVendor}=="067b", SYSFS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# ATEN International Co., Ltd UC-232A Serial Port [pl2303]
SYSFS{idVendor}=="0557", SYSFS{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# FTDI 8U232AM
SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# Cypress M8/CY7C64013 (DeLorme uses these)
SYSFS{idVendor}=="1163", SYSFS{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005)
SYSFS{idVendor}=="067b", SYSFS{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB)
SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241)
SYSFS{idVendor}=="10c4", SYSFS{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
# u-blox AG, u-blox 5 (tested with Navilock NL-402U)
SYSFS{idVendor}=="1546", SYSFS{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"

ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper"

LABEL="gpsd_rules_end"


Thank you

Didier Spaier 05-29-2011 05:57 AM

There is a slackbuild available for gpsd on slackbuilds.org, see http://slackbuilds.org/repository/13.37/system/gpsd/

Not sure it will answer you question -- but at least it can help you keep your system clean ;)

xj25vm 05-29-2011 06:40 AM

Thanks for the reply. I've actually used the slackBuilds script - just modified it to use version 2.96 instead of 2.95. The slackBuilds script does not install or configure any of the udev rules. I had to copy them manually from the source code. If I manage to get it going, I would like to go back to slackBuilds and suggest they modify their script to automatically configure the udev stuff.

As a follow-up to my post above - I know that the rule gets triggered during boot - because gps0 shows up in /dev - otherwise it would be just ttyUSB0. I just can't figure out why the RUN script doesn't get run.

Sebastian

55020 05-29-2011 06:56 AM

I'm pretty sure the SBo gpsd won't help with the udev problem -- it doesn't even try to do anything with udev rules. So thanks to xj25vm for poking it with a stick :)

I'll do some experiments this afternoon, and if we end up with success, I'll try to include some optional support for udev in the SBo SlackBuild -- even if it's just a new paragraph in the README. (Niels Horn just approved an update for version 2.96, so apologies to Niels if we change it again in the near future!)

xj25vm 05-29-2011 08:03 AM

It seems there is a problem with the udev setup - either in general, or the way it is configured in Slackware. I can't run anything from a udev rule. I've tried the following simple setup which is supposed to write a simple file in /var/run during boot if the gps dongle is connected:

Code:

#/etc/udev/ruled.s/99-gpsd.rules
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", RUN="/lib/udev/gpsd.test"


Code:

#!/bin/bash
#/lib/udev/gpsd.test

/bin/touch /var/run/gpsd.test

The above produces nothing. I've tried turning up logging on udev - to see what's happening - but can't find anything relevant in the logs. It's like there is no way of running any sort of script from udev during boot. Unless I'm missing an essential bit of information somewhere. I know the attributes in the udev rule are correct, because if I use SYMLINK instead of RUN - I do end up with the correct symlink under /dev created during boot.

I don't think we stand a chance of getting the gpsd started automatically by udev during boot if the RUN argument doesn't work (although, bizarrely, it works fine if the computer is booted/running and the usb gps dongle is inserted).

Sebastian

55020 05-29-2011 10:56 AM

Well, I think I know what's going on here, and it isn't pretty.

gpsd insists on having a control socket at /var/run/gpsd.sock (even if you set the relevant variable in /etc/default/gpsd to a null string). Unfortunately, neither gpsd nor /lib/udev/gpsd.hotplug can create this socket when /etc/rc.d/rc.udev is doing its coldplug thing, because the root filesystem is still read-only at this point in the boot.

(Digression: you can see this happening if you dial up udev's log level and ctrl-s the display at just the right point.

Code:

udevd-work[1057]: '/etc/udev/gpsd-hotplug-wrapper' started
udevd-work[1057]: '/etc/udev/gpsd-hotplug-wrapper' (stderr) 'gpsd:ERROR: can't listen on local socket /var/run/gpsd.sock'
udevd-work[1057]: '/etc/udev/gpsd-hotplug-wrapper' (stderr) 'gpsd:ERROR: control socket create failed. netlib error -1'
udevd-work[1057]: '/etc/udev/gpsd-hotplug-wrapper' returned with exitcode 0

Digression continues: because the filesystem is still read-only, udevd's output isn't logged into /var/log/messages -- I had to write the above messages down with a biro and type them by hand -- and also presumably that's why your attempt to touch /var/run/gpsd.test fails.)

Note also, that despite the above failure, the other part of the udev rule -- creating the extra device symlink /dev/gpsN -- actually works ok.

Maybe there would be a happy ending if only gpsd.hotplug and gpsd.hotplug.wrapper exited with an error code having failed to create the socket. Then, when Slackware later invokes udevadm trigger --type=failed, the scripts would run again, and would succeed. (This stuff is complicated. Am I getting it right?!) Alas, this does not happen. The reason why it doesn't or can't return an error code might be the unrelated situation that's described in the comments in gpsd.hotplug

Quote:

# In recent versions of udev, the gpsd script runs in series with
# the task that creates the real /dev/ttyUSB0 device
# node. Unfortunately, the gpsd script runs BEFORE the creation of
# the node, and the node is not created until after you kill the
# gpsd script, because the gpsd script waits forever for the node
# to appear.
#
# This is a race condition, and is best fixed by running the
# actual wait/hotplug portion in the background.
All things considered, the special moment has now arrived where I point out that, just because I package this stuff for SBo doesn't mean that I endorse the way upstream does things :rolleyes:

The best fix for booting would be to edit rc.local so that it starts gpsd if /dev/gps0 exists. You can leave everything else exactly the way it is now so that hotplug will also work.

catkin 05-29-2011 11:20 AM

Here's a scrippet that might help.
Code:

while true
do
    buf=$( runlevel )
    runlevel=${buf#* }
    case $runlevel in
        0 | 1 | s | S )
            sleep 5
            continue
    esac
    break
done
<start gpsd>

Alternatively you could loop waiting for the necessary file system(s) to be writable.

xj25vm 05-29-2011 12:00 PM

Hi 55020,

I think I followed pretty much all your explanation. Thank you for that - I didn't realise the first pass of udev is done while the root filesystem is in read-only mode. I am on the gpsd mailing list - and I will try to see if there is any interest in modifying the two hotplug scripts to return a non-zero value in case of failure.

The problem with starting gpsd from rc.local (which I have considered) is that once the boot is out of the way, I will end up with a running gpsd, but not with a usb gps adapter connected to it - if it was plugged in before the computer is started. That is because the hotplug script sends commands to the gpsd daemon through the socket to connect to the gps device. That unless I start gpsd with the device name (/dev/ttyUSB0) on the command line. This relies on the gps dongle being assigned the same device name everytime - which might just work in my particular setup. It's just not that elegant as the hotplug.

xj25vm 05-29-2011 12:39 PM

I'm trying to modify the gpsd.hotplug.wrapper script to return a failure message if it can't write to the filesystem - so that it get's re-run after the filesystem is mounted rw.

I'm experimenting with a very simple script like this:

Code:

#!/bin/bash
#/lib/udev/gpsd.test

if ! /bin/touch /var/run/gpsd.test; then

  sleep 5
  exit 1

fi

sleep 5
exit 0

My rule file is this:

Code:


#/etc/udev/ruled.s/99-gpsd.rules
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", RUN="/lib/udev/gpsd.test"

I can see it is run during the boot (as it pauses the boot for 5 seconds, that's why I used the sleep statements). However, it doesn't seem to run on the second udev trigger (retry=failed) later on. The system doesn't pause, and the file doesn't get created.

What does it take to register a rule as failed with udev - so that it gets re-run later on? I was thinking an exit code of 1 for a bash script should have been enough. I've read the man page for udev and udevadm - but they don't seem to say how exactly to fail a rule.

Sebastian

P.S. - Sorry for being a bit OT here - but I thought I better keep all the conversation belonging to the gpsd and udev problem in one place.

55020 05-29-2011 01:17 PM

Quote:

Originally Posted by xj25vm (Post 4370258)
The problem with starting gpsd from rc.local (which I have considered) is that once the boot is out of the way, I will end up with a running gpsd, but not with a usb gps adapter connected to it - if it was plugged in before the computer is started. That because the hotplug script sends commands to the gpsd daemon through the socket to connect to the gps device. That unless I start gpsd with the device name (/dev/ttyUSB0) on the command line. This relies on the gps dongle being assigned the same device name everytime - which might just work in my particular setup. It's just not that elegant as the hotplug.

You could use /dev/gps0 instead of /dev/ttyUSB0 on the gpsd command line. At least that'll point to whatever udev considers to be the first GPS device. But yeah, it won't work for anything other than simple use cases.

The udev rules supplied by gpsd are neither elegant nor foolproof; they assume that more or less any serial USB converter is a GPS. I use the exact same serial cable with an eTrex and at other times with various scientific data loggers, and additionally I've got a diabetes blood glucose meter with the exact same PL2303 USB id. There is no way that udev can distinguish these use cases. And that's why I don't use gpsd hotplug. It doesn't fit my lifestyle :cool: but YMMV...

xj25vm 05-29-2011 04:20 PM

I have used gpsd with manual start for almost two years now on my own laptop - and I would have kept on using it. But I'm currently working on a vehicle onboard tracking system, using Slack and gpsd - and that's when I stumbled over this whole $£%^$ - erm, extra complication. This computer will be physically locked in its case, will start automatically when the engine starts - so it needs a reliable way of starting gpsd without any intervention. I will probably stick with doing "gpsd -n /dev/ttyUSB0" from rc.local - and this will fit my use case this time.

I would have loved it, however, if I could have come up with a more flexible script to do things properly, from udev - which would have worked well on Slackware - so that it can be added to the SBo repository. Well, I suppose you win some, you lose some :-) .

In retrospect, gpsd should really include the option to scan for usb devices itself when it starts and add the right ones automatically to it's pool. This way a gpsd startup script just doing "gpsd --watch-usb" or something similar would have been enough. At worst, a udev rule including "gpsd --rescan" to tell gpsd when to have another look for new devices should cover all situations. At least I think that would have been the neatest way.

55020 05-29-2011 06:16 PM

How about leaving 99-persistent-gpsd.rules in place, and putting this in /etc/rc.local
Code:

if [ -l /dev/gps0 -a -x /lib/udev/gpsd-hotplug ]; then
  /lib/udev/gpsd-hotplug add $(readlink /dev/gps0)
fi

I think it does everything which upstream's code purports to do, except that it won't start gpsd in single-user mode coldplug. And IMO that's most definitely a feature, not a bug. Oh, and it doesn't cope with multiple devices (just repeat for each /dev/gps*).


Meanwhile, to answer your earlier question: "What does it take to register a rule as failed with udev - so that it gets re-run later on?" -- apparently this is the magic invocation (but I had to look it up, and haven't tried it).

Code:

ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", RUN{fail_event_on_error}="/lib/udev/gpsd.test"

xj25vm 05-29-2011 06:37 PM

Thank you for that. In that case, I wonder if we can suggest two modifications to the gpsd team:

1. Modify their existing udev rule file to add "{fail_event_on_error}" for every line of the file.
2. Modify the gpsd.hotplug.wrapper script to include a test along the lines:

Code:


# test if /var/run is on a fs mounted rw
if /bin/touch /var/run/gpsd.test; then
  rm /var/run/gpsd.test
else
  exit 1
fi

Unless somebody can think of a neater way to test if the file-system is mounted rw.

This way, the gpsd.hotplug.wrapper should fail on the first udev run, and should succeed on the second run.

Wouldn't the two modifications above make the upstream setup fully compatible with Slackware (in theory - I haven't tried it yet)? - while keeping it compatible with the other distros as well. I really would like if that would be the case, instead of having some modifications which only apply to one distribution. It would also be easier to package.

xj25vm 05-30-2011 03:58 AM

I've just tried the {fail_event_on_error} option and it seems to do nothing. It runs the script on the first pass of udev (and fails to write the file to /var/run), but doesn't run it on the second pass.

xj25vm 05-30-2011 04:14 AM

1 Attachment(s)
OK - I think I have a compromise solution to suggest for the SBo repository. I've built an rc.gpsd script to go in /etc/rc.d and be triggered from rc.local. This will:

1. Start gpsd
2. Pass ttyUSB0 (or any other device) on the command line, in case the usb dongle was already plugged in when the computer booted.
3. Also pass -F /var/run/gpsd.sock option on the command line, so that the gpsd daemon can be interracted with by gpsctl through udev, and receive any new device plugged in after the computer boots.

In conjunction with using /udev/lib/gpsd.hotplug, /udev/lib/gpsd.hotplug.wrapper, gpsd.rules (maybe renamed /etc/udev/rules.d/99-persistent-gpsd.rules to fit what seems to be Slackware naming style) - this should cover most use cases, of having the device plugged in when the computer starts, and plugging it in later.

I attach the rc.gpsd here (remove .txt from the end). The other files are in the gpsd sources.

What do you think?

55020 05-30-2011 04:23 PM

Yes, the general approach sounds good and I've grabbed a copy of your rc script. It's too late for the 2.96 update, which has already been approved, but I'll definitely include this with the SBo SlackBuild next time, though it probably won't be fully enabled by default, to avoid surprises for people upgrading. gpsd 3.0 will be a big update anyway, as it's going over to cmake -- I already have an early draft and I'll update it and put it on github in the very near future.

As I said before, thanks for poking this with a pointy stick. It's been on my TODO list (near the bottom, just above "do proper backups") for a very long time and you've helped a lot :cool:

xj25vm 05-30-2011 05:45 PM

I am the one who should thank you for answering my questions, throwing in ideas and generally for any work you do for SBo. As a slacker, I find it very useful.

I've sent an email to both the gpsd-users and gpsd-dev lists suggesting that they might consider moving to a standard /etc/gpsd.conf file, with [global] and [device_name] type sections, based on serial number of devices (as hardware id's are unreliable for gps devices), and a gpsdconf command line wizard which can be run every time a new usb adapter is used for the first time - which would update gpsd.conf with the correct serial number, and any options the user might wish for that adapter. The whole process would be akin to pairing up with a gpsd adapter/receiver - the way bluetooth devices get paired up the first time they connect. This way, gpsd could use inotify (or something else) to know when a new ttyUSBx or ttySx device is plugged in, and if the serial number is in gpsd.conf, it would connect to it automatically. No more udev, no more gpsd.hotplug and gpsd.hotplug.wrapper and the rest of the complication. All would one do is start the gpsd binary on system startup, and be done with it.

In my mind, this would be a wonderfully simplified system - but I'm not holding my breath over it getting any traction. I could have equally missed something important in my grand scheming anyway :-)

I'll mark this thread as solved now - as I think it is as solved as it will ever get considering all factors involved. Thanks again for all your help.



P.S. Here is my idea of a /etc/gpsd.conf file:

Code:


#/etc/gpsd.conf
[global]
# port gpsd is listening on
port = "2947"
# socket for clients passing commands to gpsd
socket = "/var/run/gpsd.sock"
# start poling devices immediately
no_wait = "yes"
# don't re-configure the device
bt_safe = "no"

[my_gps_1]
serial = "0490r39c99d40"
# overwrite global setting
bt_safe = yes

[my_gps_2]
serial = "4999dfleklj5534"
# span a different daemon for this one
# and listen on different port
port = "3011"

[my_gps_3]
serial = "994sle4900032"
# this adapter is temporarily disabled
enable = "no"


xj25vm 06-11-2011 03:22 AM

1 Attachment(s)
I'm attaching a modified version of the rc.gpsd script as I've discovered two bugs in the previous version. I've also added some comments at the top to explain why this script is necessary under Slackware. I'm hoping 55020 you are still monitoring this thread.

55020 06-12-2011 05:53 AM

Hi Sebastian, have a look at http://github.com/idlemoor/SBo-fork/...edingEdge/gpsd which I have been working on for a while -- this is a experimental preview of what will become the SBo SlackBuild when gpsd-3.0 is released. It now includes your new rc.gpsd, revised somewhat. Among the changes, it uses /dev/gps0 instead of /dev/ttyUSB0 (thus allowing coexistence of a GPS with any other USB serial devices, if they are distinguishable to udev). This isn't enabled by default. Read the README.

The README also points out that there is now a dependency on scons, which is available from SBo.

Before building gpsd, you'll need to make a tarball from the gpsd project's git repository. If you're comfortable doing that, fine, otherwise you can use the repo2tarball script I've been hacking lately, which is in a parallel subdirectory in the BleedingEdge section of my github. This will clone/pull from the remote git repo, and create a tarball named something like gpsd-master.6bf5d9e.tar.gz. You then build gpsd from this tarball and install/upgrade the package as usual:

Code:

repo2tarball gpsd
VERSION=master.6bf5d9e sh gpsd.SlackBuild
upgradepkg /tmp/gpsd-master.6bf5d9e-x86_64-1_SBo.tgz

To reiterate, this is experimental - handle with care, feedback is welcome.

xj25vm 06-12-2011 10:28 AM

I've had a look at github and I like the look of things. One minor suggestion. If it would be me, I would keep all the options inside rc.gpsd - and keep the part that goes into rc.local as minimal as possible. So in rc.local I'd put something like:

Code:

if [ -x /etc/rc.d/rc.gpsd ]; then
  /etc/rc.d/rc.gpsd start
fi

While I would add the following to rc.gpsd somewhere towards the top:

Code:

if [ ! -e $GPSD_DEVICE ]; then
  exit 1
fi

for a quiet exit, or make it more verbose. This way the bit in rc.local looks more "traditional" or in line with other similar statements that go in rc.local, and /dev/gps0 doesn't end up being hardwired in rc.local - so that it would need changing in two different locations (rc.local and rc.gpsd) if somebody wants to use a different device name for any reason.

I like your "GPSD_SOCKARG" idea - I couldn't think of a suitable name for that variable.

55020 06-12-2011 11:03 AM

Will do. In particular, you're right about the device name and it makes mincemeat of the bogus reason why I did it that way. Ta!

xj25vm 06-12-2011 11:22 AM

I was just looking at the udev rule supplied by the gpsd team. I just realised that, if several usb-to-serial devices are plugged in (not necessarily all gps receivers) - there is no guarantee that the gps receiver will end up under /dev/gps0. They use "SYMLINK+="gps%n" which I believe means that it will take the same number assigned by the kernel to /dev/ttyUSBx which is linking to. There could be only one gps receiver plugged (next to other usb-to-serial devices) and still end up as /dev/gps3 or /dev/gps4. And no way to control this with the current settings. In the light of this, the way I see it there are two options:

1. Modify the udev rule and recommendation, so that people hardwire their own device number e.g. instead of using "SYMLINK+="gps%n" use "SYMLINK+=gps0".
2. Or, modify rc.gpsd, by removing GPSD_DEVICE variable, and instead do something like "ls /dev/gps*", check if anything comes out of that, and if yes, for first device found start gpsd on it. That of course makes the willing assumption there is only one gps receiver plugged in when the computer starts, and/or ignores any other.

Otherwise we would deal with a situation where rc.gpsd relies on the chance that the gps receiver is the first one to be polled by udev of any serial-to-usb devices connected - which, I would think, is very flimsy. It also pretty much ruins one of the main purposes of using udev for this - which, I believe, was to deal with having several usb-to-serial devices plugged in.

Unless I'm misunderstanding the udev rules.

xj25vm 06-12-2011 02:16 PM

I worked a bit on the latest version of rc.gpsd and I adapted it to cope with /dev/gpsx devices numbered in an unpredictable fashion. Also, I adapted it to cope with an unknown number of gps devices plugged in when the computer starts. I know this is somewhat unlikely - but I think this way it is more flexible and robust. If you think this is overkill, it could be changed to just start gpsd on the first device encountered. Here is the part of it I've modified:

Code:


# No need for the options or socket variables - as they get read
# by the hotplug script from /etc/default/gpsd. No point in having two sets of settings

gpsd_start() {

  GPS_DEVICE_COUNT=`ls -l /dev/gps* 2>/dev/null | wc -l`

  if [ "$GPS_DEVICE_COUNT" -eq "0" ]; then
    echo "$0: No /dev/gps found. Will not start gpsd"
    exit 1
  fi

  #  will check only for hotplug scripts - the only ones we need directly
  if [ ! -x /lib/udev/gpsd.hotplug -o ! -x /lib/udev/gpsd.hotplug.wrapper ]; then
    echo "$0: no gpsd hotplug scripts (or not executable); cannot start."
  fi

  # Now start one by one all devices
  for GPS_RECEIVER in /dev/gps*; do
    # the hotplug scripts expect the variables below in the environment
    export OPTIONS="$GPSD_OPTIONS"
    export ACTION="add"
    export DEVNAME="$GPS_RECEIVER"
    echo "$0: Starting $GPS_RECEIVER"
    /lib/udev/gpsd.hotplug.wrapper
  done

}

It feels a bit like going in one big circle - and ending close to where I started - but I think the code above should take care of everything. One of these days when I'll grow some extra cells on the brain I'll have to sit down and write a C wrapper which takes care of everything properly and does all the checks - three layers of scripts to start one piece of software is really silly from where I'm standing. Then again, after trying for 2 days to convince the project leader for gpsd to make life a bit easier for those who interact with his software - I'm not holding my breath there will be any change from that direction.

55020 06-14-2011 11:55 AM

Sorry for using this thread to conduct a dialogue of diminishing public interest, but I've just pushed a new set of gpsd files to Github, including fixes for the device numbering issue Sebastian pointed out, the config issue, and patches for a number of ghastly upstream problems.

There is now a config file at /etc/rc.d/rc.gpsd.conf, which is where it should be in any distro of good taste and discernment ;)

I might try to do an LQ Blog about this, so that we have somewhere else to discuss any matters arising.


All times are GMT -5. The time now is 05:06 PM.