[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH resend] systemd/*: Use @SBINDIR@.
From: |
Ladislav Michl |
Subject: |
[PATCH resend] systemd/*: Use @SBINDIR@. |
Date: |
Wed, 26 Aug 2020 12:23:35 +0200 |
Make systemd service files respect actual binaries location.
---
This is just a resend after release in a hope it could be well
tested before the next release
.gitignore | 1 +
SConstruct | 1 +
systemd/{gpsd.service => gpsd.service.in} | 2 +-
systemd/gpsdctl@.service.in | 4 ++--
4 files changed, 5 insertions(+), 3 deletions(-)
rename systemd/{gpsd.service => gpsd.service.in} (82%)
diff --git a/.gitignore b/.gitignore
index 6883316de..6061b43a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -199,6 +199,7 @@ tmp*
# config file created by gpsd.php
gpsd_config.inc
# for systemd(umb)
+systemd/gpsd.service
systemd/gpsdctl@.service
systemd/gpsd.socket
# for 3rd party packaging
diff --git a/SConstruct b/SConstruct
index c9dddcaf5..69e6d471d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2078,6 +2078,7 @@ substmap = (
('@PYPACKETH@', pythonized_header),
('@QTVERSIONED@', env['qt_versioned']),
('@RUNDIR@', env['rundir']),
+ ('@SBINDIR@', installdir('sbindir', add_destdir=False)),
('@SCPUPLOAD@', scpupload),
('@SHAREPATH@', installdir('sharedir')),
('@SITENAME@', sitename),
diff --git a/systemd/gpsd.service b/systemd/gpsd.service.in
similarity index 82%
rename from systemd/gpsd.service
rename to systemd/gpsd.service.in
index c1f193cc6..768e3dcd6 100644
--- a/systemd/gpsd.service
+++ b/systemd/gpsd.service.in
@@ -8,7 +8,7 @@ After=chronyd.service
Type=forking
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
-ExecStart=/usr/local/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
+ExecStart=@SBINDIR@/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES
[Install]
WantedBy=multi-user.target
diff --git a/systemd/gpsdctl@.service.in b/systemd/gpsdctl@.service.in
index c09fc19f9..dd8d3cb89 100644
--- a/systemd/gpsdctl@.service.in
+++ b/systemd/gpsdctl@.service.in
@@ -10,5 +10,5 @@ Environment="GPSD_SOCKET=@RUNDIR@/gpsd.sock"
EnvironmentFile=-/etc/default/gpsd
EnvironmentFile=-/etc/sysconfig/gpsd
RemainAfterExit=yes
-ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/local/sbin/gpsdctl add
/dev/%I || :"
-ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && /usr/local/sbin/gpsdctl remove
/dev/%I || :"
+ExecStart=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl add /dev/%I
|| :"
+ExecStop=/bin/sh -c "[ \"$USBAUTO\" = true ] && @SBINDIR@/gpsdctl remove
/dev/%I || :"
--
2.28.0
- [PATCH resend] systemd/*: Use @SBINDIR@.,
Ladislav Michl <=