Bug 680074

Summary: postin scriptlet failure
Product: [Fedora] Fedora Reporter: Rahul Sundaram <metherid>
Component: systemdAssignee: Lennart Poettering <lpoetter>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jhrozek, lpoetter, metherid, mschmidt, notting, plautrba, sbose, sgallagh, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-04 01:30:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Rahul Sundaram 2011-02-24 10:03:39 UTC
Updating in Fedora 15 branch today,  

 Updating   : sssd-1.5.1-8.fc15.x86_64                                  54/244 
Non-fatal POSTIN scriptlet failure in rpm package sssd-1.5.1-8.fc15.x86_64
Job failed. See system logs and 'systemctl status' for details.
warning: %post(sssd-1.5.1-8.fc15.x86_64) scriptlet failed, exit status 1

Comment 1 Jakub Hrozek 2011-02-24 18:23:45 UTC
This is reproducable on clean install on F-15, too.

We're doing the classic %post thing:
if [ $1 -ge 1 ] ; then
    /sbin/service %{servicename} condrestart 2>&1 > /dev/null
fi

condrestart should restart the service only if it was running previously, which is not the case on clean install, obviously. We should check if systemd handles condrestart correctly and if this is the correct way packaging-wise in the systemd world.

Comment 2 Jakub Hrozek 2011-02-24 18:26:15 UTC
(In reply to comment #0)
> Updating in Fedora 15 branch today,  
> 
>  Updating   : sssd-1.5.1-8.fc15.x86_64                                  54/244 
> Non-fatal POSTIN scriptlet failure in rpm package sssd-1.5.1-8.fc15.x86_64
> Job failed. See system logs and 'systemctl status' for details.
> warning: %post(sssd-1.5.1-8.fc15.x86_64) scriptlet failed, exit status 1

Rahul, since it was an upgrade in your case, was SSSD running before the upgrade? Can you check /var/log/messages and /var/log/sssd/sssd.log ? It should have some hints on why SSSD did not restart correctly.

Comment 3 Rahul Sundaram 2011-02-24 18:50:07 UTC
Nothing relevant in /var/log/messages and /var/log/sssd/sssd.log doesn't exist on my system. Never used sssd and it was not running on my system.  For systemd related packaging guidelines, refer to

https://fedoraproject.org/wiki/Systemd_Packaging_Draft

Comment 4 Jakub Hrozek 2011-02-28 10:21:04 UTC
OK, this seems to be a systemd bug. conrestart should restart if and only if the service was running previously:

----
# ps -ef | grep sssd
root     29725 29579  0 10:17 pts/0    00:00:00 grep --color=auto sssd
# service sssd status
sssd.service - LSB: System Security Services Daemon
	  Loaded: loaded (/etc/rc.d/init.d/sssd)
	  Active: failed since Thu, 24 Feb 2011 18:15:04 -0500; 3 days ago
	 Process: 1141 ExecStart=/etc/rc.d/init.d/sssd start (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/sssd.service
# service sssd condrestart
Restarting sssd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]
------

Reassigning to systemd.

Comment 5 Lennart Poettering 2011-03-01 01:39:27 UTC
Hmm, from a first glance over this: the %postin scripts should use "|| :" in all lines to avoid any failures.

Comment 6 Jakub Hrozek 2011-03-01 14:57:54 UTC
(In reply to comment #5)
> Hmm, from a first glance over this: the %postin scripts should use "|| :" in
> all lines to avoid any failures.

Yes, I agree with this. Using "|| :" we would see the error but the scriptlet wouldn't fail completely. Thanks for pointing this out.

I still think condrestart does not behave properly as per comment #4.

Comment 7 Stephen Gallagher 2011-03-04 01:30:04 UTC

*** This bug has been marked as a duplicate of bug 635780 ***