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

Lukas Slebodnik lslebodn at redhat.com
Mon Aug 11 06:38:54 UTC 2014


On (10/08/14 19:31), Jakub Hrozek wrote:
>Hi,
>
>see the attached patch. To the best of my knowledge, the bug only
>affects old, sysv-based distributions, not systemd based ones.

>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

"%posttrans" is the last one scriptlet.
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Scriptlet_Ordering

"%posttrans" section could be the last scriptlet and not in the middle of
other, but it is not important.

ACK

LS



More information about the sssd-devel mailing list