Bug 1014511

Summary: non-fatal devtoolset-2-runtime failure
Product: Red Hat Developer Toolset Reporter: Miroslav Franc <mfranc>
Component: devtoolset-metaAssignee: Marek Polacek <mpolacek>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: low Docs Contact:
Priority: low    
Version: DTS 2.0 RHEL 6CC: jakub, mfranc, mnewsome, ohudlick
Target Milestone: ---   
Target Release: 2.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-2-2.1-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-11 06:34:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Miroslav Franc 2013-10-02 09:09:47 UTC
# rpm -e devtoolset-2-runtime
restorecon:  lstat(/opt/rh/devtoolset-2/root) failed:  No such file or directory
warning: %postun(devtoolset-2-runtime-2.0-19.el6.noarch) scriptlet failed, exit status 255


# rpm --scripts -q devtoolset-2-runtime
...
postuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
  /usr/sbin/semanage fcontext -d /opt/rh/devtoolset-2/root
  restorecon -R /opt/rh/devtoolset-2/root
fi


Happened during `yum remove devtooolset-2\*' as well.  It seems that on rhel6 /opt/rh/devtoolset-2/root belongs to devtoolset-2-runtime package and is removed before the postun scriptlet is run witch causes restorecon to end with 255 return code.

Comment 1 Marek Polacek 2013-10-02 09:20:10 UTC
Hopefully just adding '[ -d %{_scl_root} ] &&' will do; it does not make much sense to restore contexts on non-existing files.

Comment 2 Miroslav Franc 2013-10-02 10:29:54 UTC
(In reply to Marek Polacek from comment #1)
> Hopefully just adding '[ -d %{_scl_root} ] &&' will do; it does not make
> much sense to restore contexts on non-existing files.

Wouldn't adding '[ -d %{_scl_root} ] &&' just change the bad return code from 255 to 1?  if-then-fi would be better IMHO.

Comment 3 Marek Polacek 2013-10-02 10:57:50 UTC
You're right.  I meant '[ -d %{_scl_root} ] && ... || :'.

Comment 4 Marek Polacek 2013-10-03 09:53:44 UTC
I put the (untested) fix in, so hopefully fixed.

Comment 8 errata-xmlrpc 2014-03-11 06:34:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0278.html