[heat] Updated systemd scriptlets to macros for F18

Jeff Peeler jpeeler at fedoraproject.org
Tue Aug 21 18:42:45 UTC 2012


commit b709618fa62bc7d31134da770e8480667dfc6335
Author: Jeff Peeler <jpeeler at redhat.com>
Date:   Tue Aug 21 14:41:18 2012 -0400

    Updated systemd scriptlets to macros for F18
    
    Based off upstream 44492af7609dc156f819aa85c6aef154b4dd5e3
    
    Signed-off-by: Jeff Peeler <jpeeler at redhat.com>

 heat.spec |   34 +++++++++++++---------------------
 1 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/heat.spec b/heat.spec
index 98e0912..d93e3dd 100644
--- a/heat.spec
+++ b/heat.spec
@@ -1,7 +1,7 @@
 Name: heat
 Summary: This software provides AWS CloudFormation functionality for OpenStack Essex
 Version: 5
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: ASL 2.0
 Group: System Environment/Base
 URL: http://heat-api.org
@@ -98,32 +98,24 @@ useradd -u 187 -r -g openstack-heat -d %{_localstatedir}/lib/heat -s /sbin/nolog
 exit 0
 
 %post
-if [ $1 -eq 1 ] ; then
-    # initial installation
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post heat-api.service
+%systemd_post heat-engine.service
+%systemd_post heat-metadata.service
 
 %preun
-if [ $1 -eq 0 ] ; then
-    # package removal, not upgrade
-    /bin/systemctl --no-reload disable heat-api.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable heat-engine.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable heat-metadata.service > /dev/null 2>&1 || :
-    /bin/systemctl stop heat-api.service > /dev/null 2>&1 || :
-    /bin/systemctl stop heat-engine.service > /dev/null 2>&1 || :
-    /bin/systemctl stop heat-metadata.service > /dev/null 2>&1 || :
-fi
+%systemd_preun heat-api.service
+%systemd_preun heat-engine.service
+%systemd_preun heat-engine.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # package upgrade, not uninstall
-    /bin/systemctl try-restart heat-api.service >/dev/null 2>&1 || :
-    /bin/systemctl try-restart heat-engine.service >/dev/null 2>&1 || :
-    /bin/systemctl try-restart heat-metadata.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart heat-api.service
+%systemd_postun_with_restart heat-engine.service
+%systemd_postun_with_restart heat-metadata.service
 
 %changelog
+* Tue Aug 21 2012 Jeff Peeler <jpeeler at redhat.com> 5-5
+- updated systemd scriptlets
+
 * Tue Aug  7 2012 Jeff Peeler <jpeeler at redhat.com> 5-4
 - make UID/GID more specific as openstack-heat
 


More information about the scm-commits mailing list