aboutsummaryrefslogtreecommitdiffstats
path: root/main/gpsd
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2019-12-11 22:17:43 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-01-28 00:09:48 +0100
commit26885f528f89f856b4b5eca758f21d1b32cfa4f3 (patch)
treeeecb7030bc35a3d2de0a99759578a5ab9438bd4d /main/gpsd
parent8b94b8f6304b35b667cde9c3e51263a304f445fb (diff)
downloadaports-26885f528f89f856b4b5eca758f21d1b32cfa4f3.tar.bz2
aports-26885f528f89f856b4b5eca758f21d1b32cfa4f3.tar.xz
main/gpsd: use init scripts from hyperbola
This allows gpsd to start without having to manually change /etc/conf.d/gpsd
Diffstat (limited to 'main/gpsd')
-rw-r--r--main/gpsd/APKBUILD6
-rw-r--r--main/gpsd/gpsd.confd34
-rw-r--r--main/gpsd/gpsd.initd48
3 files changed, 33 insertions, 55 deletions
diff --git a/main/gpsd/APKBUILD b/main/gpsd/APKBUILD
index 666c8899f2..700752407b 100644
--- a/main/gpsd/APKBUILD
+++ b/main/gpsd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Nathan Angelacos <nangel@alpinelinux.org>
pkgname=gpsd
pkgver=3.19
-pkgrel=0
+pkgrel=1
pkgdesc="A GPS daemon"
arch=all
url="http://catb.org/gpsd/"
@@ -81,5 +81,5 @@ eb11fc19243d1789016d88eb7645bfe67c46304547781489bf36eb1dd4c252d523681ff835a6488f
b918e4b32a6e8bcd25d126e4f1a78dfdda30837a64e7d829f04b27e138843a1dbec83e64677edd6f88eca8cead511949ee664066de4429641ba248fe5a7768ef gpsd-use-local-timepps-header.patch
a0ec09823247def7b7cc5cdcc123d1ee8d5ab923b1cf7e400b6b8c35b8315e82c70f4d197dab0f3d3cba979c71c20a989617b3ca0725d4f8fa7c99c02f36ca0c 0001-workaround-for-scons-using-python2.patch
e2af8f52fc2d7e663882b6d12c5f4d709aa267b16eb9aeca2a70d8ecc681ae72359f3efcd1636cde576bc8579e008f242574bc0adfab7252d3e763f039e86135 ttydefaults.patch
-a0e7bf206ad51c31195f86f79ef92adca425d7f988534c0f70a2dd3053613f6fc46820d62d0330aaef7ca100b5f2ab781ce9643f25b4c99c844ae66e7eec5cbc gpsd.initd
-55d4a51f82d445d3ac93b2855132ef4380908ed045feba6298ed1d0b607cd9054b5325c024dc52b370983ebd5d9b377537aee7d7128c97aa22e3075f4134d404 gpsd.confd"
+51319247eb78c3021d3eb897cb5d6026cc09d46a532a245a835459ed525947ffb6239f08126dd7e344de52e3b0387226bce060191ec3f14f99fc9f255d96f8ea gpsd.initd
+75dbfe39eb900cc9587dd70794ee77ae2230765bbede47760ca227145aa3f2290b6995335ffcfeae6cd86f56b01ca87367548f4fbcf810aff1bc012b7416deef gpsd.confd"
diff --git a/main/gpsd/gpsd.confd b/main/gpsd/gpsd.confd
index 30af2c3ee5..0f52aa9b5e 100644
--- a/main/gpsd/gpsd.confd
+++ b/main/gpsd/gpsd.confd
@@ -1,29 +1,7 @@
-# /etc/conf.d/gpsd
-
-# The GPS device (/dev/ttyUSB0, /dev/ttyS0, ...)
-
-DEVICE=""
-BAUDRATE="4800"
-
-# Optional arguments
-# Options include:
-# -b = bluetooth-safe: open data sources read-only
-# -n = don't wait for client connects to poll GPS
-# -N = don't go into background
-# -F sockfile = specify control socket location
-# -G = make gpsd listen on INADDR_ANY
-# -D integer (default 0) = set debug level
-# -S integer (default 2947) = set port for daemon
-
-ARGS="-n "
-
-# Serial setup
-#
-# For serial interfaces, options such as low_latency are recommended
-# Also, http://catb.org/gpsd/upstream-bugs.html#tiocmwait recommends
-# setting the baudrate with stty
-# Uncomment the following lines if using a serial device:
-#
-# /bin/stty -F ${DEVICE} ${BAUDRATE}
-# /bin/setserial ${DEVICE} low_latency
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Config file for gpsd server
+GPSD_OPTIONS=""
+DEVICES=""
+GPSD_SOCKET="/var/run/gpsd.sock"
diff --git a/main/gpsd/gpsd.initd b/main/gpsd/gpsd.initd
index ea7f2ad477..d2a30071a2 100644
--- a/main/gpsd/gpsd.initd
+++ b/main/gpsd/gpsd.initd
@@ -1,38 +1,38 @@
#!/sbin/openrc-run
-# Copyright 2012 Nathan Angelacos
-
-description="GPS daemon"
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
depend() {
- need net
- after firewall
- use ntp-server
+ after dbus
+ before ntpd
}
-GPS=${SVCNAME#*.}
-if [ -n "${GPS}" ] && [ ${SVCNAME} != "gpsd" ]; then
- GPSPID="/var/run/gpsd.${GPS}.pid"
-else
- GPSPID="/var/run/gpsd.pid"
-fi
+PIDFILE=/var/run/${SVCNAME}.pid
+DAEMON=/usr/sbin/gpsd
-start() {
+checkconfig() {
+ # Note: these GPSD_xxx var names should be kept in sync with the udev rules.
+ if [ -z "${GPSD_SOCKET}" ] && [ -z "${DEVICES}" ]; then
+ GPSD_SOCKET="/var/run/gpsd.sock"
+ fi
- if [ -z "${DEVICE}" ]; then
- eerror "Specify a GPS device in /etc/conf.d/${SVCNAME}"
- return 1
- fi
+ if [ -n "${GPSD_SOCKET}" ]; then
+ GPSD_OPTIONS="${GPSD_OPTIONS} -F ${GPSD_SOCKET}"
+ fi
+}
+start() {
+ checkconfig
ebegin "Starting gpsd"
- start-stop-daemon --start --quiet \
- --exec /usr/sbin/gpsd \
- -- ${ARGS} -P "${GPSPID}" ${DEVICE}
- eend $? "Failed to start gpsd"
+
+ start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- \
+ ${GPSD_OPTIONS} -P ${PIDFILE} ${DEVICES}
+ eend $?
}
stop() {
ebegin "Stopping gpsd"
- start-stop-daemon --stop --quiet \
- --pidfile "${GPSPID}"
- eend $? "Failed to stop gpsd"
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile ${PIDFILE}
+ eend $?
+ rm -f ${PIDFILE}
}