summaryrefslogtreecommitdiffstats
path: root/projectroot/usr/lib/systemd/system/gpsdctl@.service
diff options
context:
space:
mode:
Diffstat (limited to 'projectroot/usr/lib/systemd/system/gpsdctl@.service')
-rw-r--r--projectroot/usr/lib/systemd/system/gpsdctl@.service12
1 files changed, 12 insertions, 0 deletions
diff --git a/projectroot/usr/lib/systemd/system/gpsdctl@.service b/projectroot/usr/lib/systemd/system/gpsdctl@.service
new file mode 100644
index 000000000..24d291408
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/gpsdctl@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Manage %I for GPS daemon
+Requires=gpsd.socket
+BindsTo=dev-%i.device
+After=dev-%i.device
+
+[Service]
+Type=oneshot
+Environment="GPSD_SOCKET=/var/run/gpsd.sock"
+RemainAfterExit=yes
+ExecStart=/usr/bin/gpsdctl add /dev/%I
+ExecStop=/usr/bin/gpsdctl remove /dev/%I