use piddir for specifying restart_flag location use piddir for specifying configure --with-statepath/pidpath/altpidpath add nut-2.8.0-piddir-owner.patch for upstream tmpfiles config creation to not append /nut and always use owner root update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name remove unused downstream tmpfiles source and code
33 lines
2.3 KiB
Diff
33 lines
2.3 KiB
Diff
diff -up nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in
|
|
--- nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles 2022-05-09 16:42:37.296229637 +0200
|
|
+++ nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in 2022-05-09 16:42:51.139030657 +0200
|
|
@@ -23,6 +23,7 @@ Type=oneshot
|
|
# don't want it to fail the unit (when it can't restart).
|
|
Environment=REPORT_RESTART_42=no
|
|
EnvironmentFile=-@CONFPATH@/nut.conf
|
|
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
|
|
ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh
|
|
ExecReload=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh
|
|
|
|
diff -up nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver@.service.in
|
|
--- nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles 2022-05-09 16:41:00.952614514 +0200
|
|
+++ nut-2.8.0/scripts/systemd/nut-driver@.service.in 2022-05-09 16:41:42.783013227 +0200
|
|
@@ -40,6 +40,7 @@ PartOf=nut-driver.target
|
|
[Service]
|
|
EnvironmentFile=-@CONFPATH@/nut.conf
|
|
SyslogIdentifier=%N
|
|
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
|
|
ExecStart=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl start "$NUTDEV"'
|
|
ExecStop=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl stop "$NUTDEV"'
|
|
# Restart really always, do not stop trying:
|
|
diff -up nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-monitor.service.in
|
|
--- nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles 2022-05-09 12:57:35.160646121 +0200
|
|
+++ nut-2.8.0/scripts/systemd/nut-monitor.service.in 2022-05-09 16:40:18.289227772 +0200
|
|
@@ -18,6 +18,7 @@ PartOf=nut.target
|
|
[Service]
|
|
EnvironmentFile=-@CONFPATH@/nut.conf
|
|
SyslogIdentifier=%N
|
|
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
|
|
ExecStart=@SBINDIR@/upsmon -F
|
|
ExecReload=@SBINDIR@/upsmon -c reload
|
|
PIDFile=@PIDPATH@/upsmon.pid
|