Run systemd macros in the correct rpm scripts

The systemd Icinga service was moved from the package bin to common in
2.2.0 but most rpm scripts like postun, preun and so on weren't adapted
accordingly.

fixes #7738
This commit is contained in:
Tim Hardeck 2014-11-20 16:29:17 +01:00 committed by Gunnar Beutner
parent 7ee0eef562
commit 3c84824883
1 changed files with 8 additions and 10 deletions

View File

@ -255,6 +255,12 @@ mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}
getent group %{icinga_group} >/dev/null || %{_sbindir}/groupadd -r %{icinga_group}
getent group %{icingacmd_group} >/dev/null || %{_sbindir}/groupadd -r %{icingacmd_group}
getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /sbin/nologin -r -d %{_localstatedir}/spool/%{name} -G %{icingacmd_group} -g %{icinga_group} %{icinga_user}
%if "%{_vendor}" == "suse"
%if 0%{?use_systemd}
%service_add_pre %{name}.service
%endif
%endif
exit 0
%if "%{_vendor}" == "suse"
@ -262,14 +268,6 @@ exit 0
%verify_permissions -e %{_rundir}/%{name}/cmd
%endif
%if "%{_vendor}" == "suse"
%if 0%{?use_systemd}
%pre bin
%service_add_pre %{name}.service
%endif
%endif
%post common
# suse
%if "%{_vendor}" == "suse"
@ -312,7 +310,7 @@ exit 0
%endif
# suse/rhel
%postun bin
%postun common
# suse
%if "%{_vendor}" == "suse"
%if 0%{?using_systemd}
@ -343,7 +341,7 @@ fi
exit 0
%preun bin
%preun common
# suse
%if "%{_vendor}" == "suse"