From 3dfc57b1bc96123eee9c99ed6e0ebea4fdba2d1c Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Oct 19 2012 21:36:33 +0000 Subject: Ticket 431 - Introduce new systemd-rpm macros in 389-ds-base spec file Added the new systemd macros https://fedorahosted.org/389/ticket/431 Reviewed by: richm(Thanks!) (cherry picked from commit 81c22d34f83c294f67adbafd1af142bea0b13a69) --- diff --git a/389-ds-base.spec b/389-ds-base.spec index 96a1920..9dfaf0b 100644 --- a/389-ds-base.spec +++ b/389-ds-base.spec @@ -210,6 +210,7 @@ rm -rf $RPM_BUILD_ROOT %post output=/dev/null +%systemd_post %{pkgname}-snmp.service # reload to pick up any changes to systemd files /bin/systemctl daemon-reload >$output 2>&1 || : # reload to pick up any shared lib changes @@ -257,8 +258,7 @@ exit 0 %preun if [ $1 -eq 0 ]; then # Final removal # Package removal, not upgrade - /bin/systemctl --no-reload disable %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || : - /bin/systemctl stop %{pkgname}-snmp.service %{groupname} > /dev/null 2>&1 || : + %systemd_preun %{pkgname}-snmp.service %{groupname} # remove instance specific service files/links rm -rf %{_sysconfdir}/systemd/system/%{groupname}.wants/* > /dev/null 2>&1 || : fi