Commit Graph

18 Commits

Author SHA1 Message Date
Harald Welte 75cbc3d0e5 Allow configuration of number of retconnect-attempts/interval 2014-12-20 15:44:30 +01:00
Harald Welte c77a9b3342 reconnect to gpsd if it disappears while we wait for fix/time
In some cases, gpsd might die while we are waiting to receive a valid
fix/time information.  In that case, we have to reconnect to gpsd
again and again, until a valid time has been received (and set as
system clock).
2013-10-14 10:39:34 +02:00
Harald Welte cb65bc5348 avoid using 99% CPU in case gpsd dies
This addresses and issue when gpsdate is running and the gpsd will be
killed (testing coredump handling).

The issue is within the libgps cod itself that doesn't handle the
result(0) of the recv syscall correctly and keeps on looping. Now in a
normal system gpsdate should only execute at the beginning and exit once
there is a date. So the window for this runtime failure is quite low.

Bug reported by Holger Freyther.
2013-08-29 17:12:25 +02:00
Holger Hans Peter Freyther 0db898e4b8 gpsdate.init: Make the killing of gpsdate work on the target
When the initscript is called gpsdate it might kill itself before
it has a way to start the new gpsdate process. Use pidof with the
full path to the gpsdate binary to avoid this.
2013-06-20 11:17:53 +02:00
Holger Hans Peter Freyther f07a52709f gpsdate.init: Implement stop using killall for now
The easiest way would be to use start-stop-daemon and let it
daemonize the process and create a pid file. Because all of this
is not there and the application unconditionally daemonizes itself
I can just use killall to stop it.
2013-06-20 10:13:18 +02:00
Holger Hans Peter Freyther 660b1b7fb7 gpsdate.init: Fix calling stop and start in the initscript
Now a stop/start could result in having two gpsdate processes
running. They luckily will die once the time has been set.
2013-06-20 10:13:14 +02:00
Harald Welte 8632014640 update init script defaults for update-rc.d 2013-04-10 16:09:58 +02:00
Harald Welte 58e3cdeb19 run until we receive valid GPS timestamp 2013-04-10 15:15:35 +02:00
Harald Welte 4ad6c932c9 daemonize after gpsd connection is established; gps fix might take time 2013-04-10 14:06:25 +02:00
Harald Welte 9964203e03 Makefile: Move -lgps to the end for particularly picky linkers 2013-04-10 13:55:10 +02:00
Harald Welte 374dc34c26 Makefile: don't put "-lgps" into LDFLAGS as this is overridden by bitbake/poky 2013-04-10 13:52:23 +02:00
Harald Welte 26067799c5 add GPLv2 2013-04-10 13:17:35 +02:00
Harald Welte 097f7dea48 add example init script for gpsdate 2013-04-10 13:03:22 +02:00
Harald Welte 3b870221a9 gpsdate: log the actual time that was set to the RTC. 2013-04-10 12:23:16 +02:00
Harald Welte f56f16539b use syslog() for reporting errors and status 2013-04-10 12:16:33 +02:00
Harald Welte e3708f5040 Add -Wall and -O2 to CFLAGS 2013-04-10 12:16:18 +02:00
Harald Welte a1aa41e813 perform up to 60 attmepts to re-connect to gpsd and print more status 2013-04-10 12:11:12 +02:00
Harald Welte 346b5d00a9 initial checkin of 'gpsdate' program 2013-04-10 10:47:19 +02:00