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)
This commit is contained in:
Mark Reynolds 2012-10-19 17:03:11 -04:00
parent 4283ccd41b
commit 3dfc57b1bc

View File

@ -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