From 079ebcc7d556421012a48546e5d10587e3464b15 Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 13 Jun 2011 16:22:53 +0200 Subject: [PATCH] make F-14 (sysv init) -> F-15 (systemd) transition more robust --- smartmontools.spec | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/smartmontools.spec b/smartmontools.spec index 9aa3bcb..4da47d3 100644 --- a/smartmontools.spec +++ b/smartmontools.spec @@ -1,7 +1,7 @@ Summary: Tools for monitoring SMART capable hard disks Name: smartmontools Version: 5.41 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 Group: System Environment/Base License: GPLv2+ @@ -77,14 +77,17 @@ rm -rf $RPM_BUILD_ROOT %preun if [ $1 -eq 0 ] ; then # Package removal, not upgrade - /bin/systemctl disable smartd.service >/dev/null 2>&1 || : + /bin/systemctl --no-reload disable smartd.service >/dev/null 2>&1 || : /bin/systemctl stop smartd.service > /dev/null 2>&1 || : fi %post -/sbin/service smartd condrestart >/dev/null 2>&1 ||: if [ $1 -eq 1 ]; then - /bin/systemctl enable smartd.service >/dev/null 2>&1 || : + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +else + if [ -n "$(find /etc/rc.d/rc5.d/ -name 'S??smartd' 2>/dev/null)" ]; then + /bin/systemctl enable smartd.service >/dev/null 2>&1 || : + fi fi %postun @@ -94,10 +97,6 @@ if [ $1 -ge 1 ] ; then /bin/systemctl try-restart smartd.service >/dev/null 2>&1 || : fi -%triggerun -- smartmontools < 1:5.40-4 -/sbin/chkconfig smartd && /bin/systemctl enable smartd.service >/dev/null 2>&1 || : - - %files %defattr(-,root,root,-) %doc AUTHORS CHANGELOG COPYING INSTALL NEWS README @@ -113,6 +112,9 @@ fi %{_datadir}/%{name} %changelog +* Mon Jun 13 2011 Michal Hlavinka - 1:5.41-2 +- make F-14 (sysv init) -> F-15 (systemd) transition more robust + * Fri Jun 10 2011 Michal Hlavinka - 1:5.41-1 - updated to 5.41