[SSSD] [PATCH] RPM: Restart service in %posttrans, not %post

Jakub Hrozek jhrozek at redhat.com
Sun Aug 10 17:31:44 UTC 2014


Hi,

see the attached patch. To the best of my knowledge, the bug only
affects old, sysv-based distributions, not systemd based ones.
-------------- next part --------------
>From af5de49d561c82d6f50f506d9f15697d8fc42657 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Sun, 10 Aug 2014 19:25:28 +0200
Subject: [PATCH] RPM: Restart service in %posttrans, not %post

When upgrading from a 1.9 version with monolithic packaging to 1.10 or
later with per-provider subpackage, sssd-common can be upgraded (and
restarted) before the new sssd-$provider is restarted. This can lead to
a startup failure, because the sssd_be process from already upgraded
sssd-common would attempt to load a sssd_$provider.so from the
legacy sssd package.

Restarting the service in %posttrans makes sure all the packages are in
place when we restart the service.

Resolves:
https://fedorahosted.org/sssd/ticket/2399
---
 contrib/sssd.spec.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 82d8e895ca0119deaa8a8dad6f96eac029ebdf99..1429c263d2de3ae45a2a35ae73e47487ce295063 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -848,9 +848,8 @@ fi
 %post common
 /sbin/chkconfig --add %{servicename}
 
-if [ $1 -ge 1 ] ; then
-    /sbin/service %{servicename} condrestart 2>&1 > /dev/null
-fi
+%posttrans
+/sbin/service %{servicename} condrestart 2>&1 > /dev/null
 
 %preun common
 if [ $1 = 0 ]; then
-- 
1.9.3



More information about the sssd-devel mailing list