Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37515407
en ru br
Репозитории ALT
S:2.8.0-alt2
5.1: 2.0.5-alt4
4.1: 2.0.5-alt3
4.0: 2.0.5-alt2
3.0: 2.0.2-alt1
www.altlinux.org/Changes

Группа :: Система/Серверы
Пакет: nut

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: nut-2.8.0-alt-systemd.patch
Скачать


From 245159e1b304d2153f33e04dd1b40ee950bffeb3 Mon Sep 17 00:00:00 2001
From: Elizaveta Morozova <morozovaes@altlinux.org>
Date: Wed, 15 Mar 2023 11:39:54 +0300
Subject: [PATCH] nut-2.8.0-alt-systemd
---
 scripts/systemd/nut-driver@.service.in | 5 +++--
 scripts/systemd/nut-server.service.in  | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/scripts/systemd/nut-driver@.service.in b/scripts/systemd/nut-driver@.service.in
index 3f1d028d6..cdf9254d7 100644
--- a/scripts/systemd/nut-driver@.service.in
+++ b/scripts/systemd/nut-driver@.service.in
@@ -38,9 +38,10 @@ PartOf=nut-driver.target
 # Finally note that "nut-driver-enumerator.service" should take care of this.
 
 [Service]
-EnvironmentFile=-@CONFPATH@/nut.conf
+EnvironmentFile=/etc/sysconfig/upsd
 SyslogIdentifier=%N
-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"'
+ExecStartPre=/bin/cp -p $UPS_CONF ${CHROOTDIR}${UPS_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 -u upsdrv -r $CHROOTDIR  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:
 StartLimitInterval=0
diff --git a/scripts/systemd/nut-server.service.in b/scripts/systemd/nut-server.service.in
index 713f5c427..0d2bbf695 100644
--- a/scripts/systemd/nut-server.service.in
+++ b/scripts/systemd/nut-server.service.in
@@ -18,11 +18,11 @@ Before=nut-monitor.service
 PartOf=nut.target
 
 [Service]
-EnvironmentFile=-@CONFPATH@/nut.conf
+EnvironmentFile=/etc/sysconfig/upsd
 SyslogIdentifier=%N
 # Note: foreground mode by default skips writing a PID file (and
 # needs Type=simple); can use "-FF" here to create one anyway:
-ExecStart=@SBINDIR@/upsd -F
+ExecStart=@SBINDIR@/upsd -F -u upsd -r $CHROOTDIR
 ExecReload=@SBINDIR@/upsd -c reload -P $MAINPID
 
 [Install]
-- 
2.33.5
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin