diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2016-01-27 15:49:02 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-01-28 13:16:17 +0100 |
commit | d2876356311fd069e793c630845fb67b0d8fa303 (patch) | |
tree | 50f3a1794ebdf12e5dbc4fed57710887ee3e110f /contrib | |
parent | 6499d0b915209b670f8e337c4fe76a8be9fa6576 (diff) | |
download | sssd-d2876356311fd069e793c630845fb67b0d8fa303.tar.gz sssd-d2876356311fd069e793c630845fb67b0d8fa303.tar.xz sssd-d2876356311fd069e793c630845fb67b0d8fa303.zip |
SPEC: Use systemd macros
It's better to do not rely on custom scripts
and do not call systemctl directly.
This is exactly purpose of systemd-rpm macros.
All sections are equivalent excluding "%post common".
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/sssd.spec.in | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 76066de9a..354431336 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -1003,24 +1003,13 @@ getent passwd sssd >/dev/null || useradd -r -g sssd -d / -s /sbin/nologin -c "Us %if (0%{?use_systemd} == 1) # systemd %post common -if [ $1 -eq 1 ] ; then - # Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi +%systemd_post sssd.service %preun common -if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - /bin/systemctl --no-reload disable sssd.service > /dev/null 2>&1 || : - /bin/systemctl stop sssd.service > /dev/null 2>&1 || : -fi +%systemd_preun sssd.service %postun common -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then - # Package upgrade, not uninstall - /bin/systemctl try-restart sssd.service >/dev/null 2>&1 || : -fi +%systemd_postun_with_restart sssd.service %else # sysv |