gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-users] gpsd and cold plugging


From: Bjørn Forsman
Subject: [gpsd-users] gpsd and cold plugging
Date: Tue, 18 Mar 2014 21:30:43 -0000

Hi all,

I'm a first time poster, please be nice :-)

I have trouble / questions about cold plugging. I'm also trying to
package gpsd for NixOS[nixos], but I think (hope!) that's irrelevant.

When the system starts after power-on, the hot (cold?) plug event for
the GPS arrives before systemd has started listening on the gpsd
sockets. That means gpsdctl (invoked by the gpsd udev rules) thinks it
needs to spawn a gpsd instance. But according to systemd / udev
documentation[udev], spawning long-running daemons from udev RUN+=
directives is not OK:

"Starting daemons or other long-running processes is not appropriate
for udev; the forked processes, detached or not, will be
unconditionally killed after the event handling has finished."

I haven't yet tested gpsd on Ubuntu, Fedora or any other mainstream
distro, but even if gpsd spawned from udev isn't directly *killed*, it
surely will not be subject to systemd's (awesome) process
supervision?!

I was thinking that the solution to this race between cold plug events
and systemd socket listening must simply be to let gpsd do an initial
scan of GPSs itself, when it starts. And stop gpsdctl from ever
spawning gpsd, because systemd already has that covered (socket based
activation). Having gpsd do the scan itself would also make restarting
it Just Work, unlike the current situation where I have to re-plug my
GPS after restarting gpsd.

Thoughts?

[nixos]: http://www.nixos.org
[udev] http://www.freedesktop.org/software/systemd/man/udev.html

Best regards,
Bjørn Forsman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]