gpsd/gpsd-systemd.patch
Miroslav Lichvar 1c437f3e86 update to 3.11
2014-08-25 12:48:31 +02:00

51 lines
1.6 KiB
Diff

From 86a8f7ecbb7040236602ffb08711ef87bcdb74f7 Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Mon, 25 Aug 2014 11:52:59 +0200
Subject: [PATCH] Update systemd files.
- use $OPTIONS and include /etc/sysconfig/gpsd to make it compatible
with current Fedora packaging
- start gpsd after chronyd service to allow connecting to SOCK
- allow enabling gpsd as a normal service not requiring socket
activation
---
systemd/gpsd.service | 5 ++++-
systemd/gpsdctl@.service | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/systemd/gpsd.service b/systemd/gpsd.service
index ef760a1..ad4be79 100644
--- a/systemd/gpsd.service
+++ b/systemd/gpsd.service
@@ -1,11 +1,14 @@
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
+# Needed with chrony SOCK refclock
+After=chronyd.service
[Service]
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
-ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $DEVICES
+ExecStart=/usr/sbin/gpsd -N $GPSD_OPTIONS $OPTIONS $DEVICES
[Install]
+WantedBy=multi-user.target
Also=gpsd.socket
diff --git a/systemd/gpsdctl@.service b/systemd/gpsdctl@.service
index 58c5176..26e49a2 100644
--- a/systemd/gpsdctl@.service
+++ b/systemd/gpsdctl@.service
@@ -8,6 +8,7 @@ After=dev-%i.device
Type=oneshot
Environment="GPSD_SOCKET=/var/run/gpsd.sock"
EnvironmentFile=-/etc/default/gpsd
+EnvironmentFile=-/etc/sysconfig/gpsd
RemainAfterExit=yes
ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/sbin/gpsdctl add /dev/%I || :"
ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/sbin/gpsdctl remove /dev/%I || :"
--
1.9.3