[nut/epel7] nut driver needs tmpfiles.d too (#1187286)

Michal Hlavinka mhlavink at fedoraproject.org
Mon Feb 23 16:49:10 UTC 2015


commit 412da6374037eb8cf96254bb251667305772bfcb
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Mon Feb 23 17:49:07 2015 +0100

    nut driver needs tmpfiles.d too (#1187286)

 nut-2.6.3-tmpfiles.patch   | 19 +++++++++++++++----
 nut-2.6.5-foreground.patch |  2 +-
 nut.spec                   | 15 ++++++++++++---
 3 files changed, 28 insertions(+), 8 deletions(-)
---
diff --git a/nut-2.6.3-tmpfiles.patch b/nut-2.6.3-tmpfiles.patch
index 7fb2e24..8cf4bb0 100644
--- a/nut-2.6.3-tmpfiles.patch
+++ b/nut-2.6.3-tmpfiles.patch
@@ -1,11 +1,22 @@
-diff -up nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.6.4/scripts/systemd/nut-monitor.service.in
---- nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles	2012-05-02 23:35:36.000000000 +0200
-+++ nut-2.6.4/scripts/systemd/nut-monitor.service.in	2012-06-14 11:38:42.408504102 +0200
+diff -up nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-driver.service.in
+--- nut-2.7.2/scripts/systemd/nut-driver.service.in.tmpfiles	2015-02-23 14:44:50.173188023 +0100
++++ nut-2.7.2/scripts/systemd/nut-driver.service.in	2015-02-23 14:45:03.915137074 +0100
+@@ -4,6 +4,7 @@ After=local-fs.target network.target
+ StopWhenUnneeded=yes
+ 
+ [Service]
++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf
+ ExecStart=@SBINDIR@/upsdrvctl start
+ ExecStop=@SBINDIR@/upsdrvctl stop
+ Type=forking
+diff -up nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.7.2/scripts/systemd/nut-monitor.service.in
+--- nut-2.7.2/scripts/systemd/nut-monitor.service.in.tmpfiles	2014-02-14 09:56:53.000000000 +0100
++++ nut-2.7.2/scripts/systemd/nut-monitor.service.in	2015-02-23 14:45:18.443083211 +0100
 @@ -3,6 +3,7 @@ Description=Network UPS Tools - power de
  After=local-fs.target network.target nut-server.service
  
  [Service]
-+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf
++ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf
  ExecStart=@SBINDIR@/upsmon
  PIDFile=@PIDPATH@/upsmon.pid
  Type=forking
diff --git a/nut-2.6.5-foreground.patch b/nut-2.6.5-foreground.patch
index ce1570c..0504e62 100644
--- a/nut-2.6.5-foreground.patch
+++ b/nut-2.6.5-foreground.patch
@@ -55,7 +55,7 @@ diff -up nut-2.7.1/scripts/systemd/nut-monitor.service.in.foreground nut-2.7.1/s
 @@ -4,9 +4,8 @@ After=local-fs.target network.target nut
  
  [Service]
- ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf
+ ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-run.conf
 -ExecStart=@SBINDIR@/upsmon
 -PIDFile=@PIDPATH@/upsmon.pid
 -Type=forking
diff --git a/nut.spec b/nut.spec
index 0d27fdd..61ffad7 100644
--- a/nut.spec
+++ b/nut.spec
@@ -13,7 +13,7 @@
 Summary: Network UPS Tools
 Name: nut
 Version: 2.7.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group: Applications/System
 License: GPLv2+ and GPLv3+
 Url: http://www.networkupstools.org/
@@ -189,7 +189,7 @@ mkdir -p %{buildroot}%{modeldir} \
 make install DESTDIR=%{buildroot}
 
 %if %{?fedora}0 > 140 || %{?rhel}0 > 60
-  install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tmpfiles.d/nut-client.conf
+  install -p -D -m 644 %{SOURCE3} %{buildroot}/usr/lib/tmpfiles.d/nut-run.conf
 %endif
 
 rm -rf %{buildroot}%{_prefix}/html
@@ -245,6 +245,7 @@ fi
 %post
 /sbin/ldconfig
 udevadm control --reload ||:
+systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || :
 %systemd_post nut-driver.service nut-server.service
 
 %preun
@@ -266,6 +267,7 @@ udevadm control --reload ||:
 
 %post client
 /sbin/ldconfig
+systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-run.conf >/dev/null 2>/dev/null || :
 %systemd_post nut-monitor.service
 
 %preun client
@@ -294,12 +296,16 @@ rm -rf %{buildroot}
 %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/ups.conf
 %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.conf
 %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsd.users
+%if %{?fedora}0 > 140 || %{?rhel}0 > 60
+/usr/lib/tmpfiles.d/nut-run.conf
+%endif
 %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-usbups.rules
 %attr(644,root,root) %{_usr}/lib/udev/rules.d/62-nut-ipmipsu.rules
 %{modeldir}/*
 %exclude %{modeldir}/netxml-ups
 %{_unitdir}/nut-driver.service
 %{_unitdir}/nut-server.service
+%ghost %{piddir}
 %{_sbindir}/upsd
 %{_bindir}/nut-scanner
 %{_bindir}/upslog
@@ -374,7 +380,7 @@ rm -rf %{buildroot}
 %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upsmon.conf
 %config(noreplace) %attr(640,root,nut) %{_sysconfdir}/ups/upssched.conf
 %if %{?fedora}0 > 140 || %{?rhel}0 > 60
-  %config(noreplace) %{_sysconfdir}/tmpfiles.d/nut-client.conf
+/usr/lib/tmpfiles.d/nut-run.conf
 %endif
 %dir %attr(750,nut,nut) %{_localstatedir}/lib/ups
 %ghost %{piddir}
@@ -435,6 +441,9 @@ rm -rf %{buildroot}
 %{_libdir}/pkgconfig/libnutscan.pc
 
 %changelog
+* Mon Feb 23 2015 Michal Hlavinka <mhlavink at redhat.com> - 2.7.2-3
+- nut driver needs tmpfiles.d too (#1187286)
+
 * Tue Aug 26 2014 Michal Hlavinka <mhlavink at redhat.com> - 2.7.2-2
 - build without powerman as it is not available in epel7
 


More information about the scm-commits mailing list