Bug 1014511 - non-fatal devtoolset-2-runtime failure
non-fatal devtoolset-2-runtime failure
Status: CLOSED ERRATA
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: devtoolset-meta (Show other bugs)
DTS 2.0 RHEL 6
All Linux
low Severity low
: ---
: 2.4
Assigned To: Marek Polacek
Martin Cermak
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-02 05:09 EDT by Miroslav Franc
Modified: 2016-01-31 21:28 EST (History)
4 users (show)

See Also:
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 02:34:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Miroslav Franc 2013-10-02 05:09:47 EDT
# 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 05:20:10 EDT
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 06:29:54 EDT
(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 06:57:50 EDT
You're right.  I meant '[ -d %{_scl_root} ] && ... || :'.
Comment 4 Marek Polacek 2013-10-03 05:53:44 EDT
I put the (untested) fix in, so hopefully fixed.
Comment 8 errata-xmlrpc 2014-03-11 02:34:06 EDT
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

Note You need to log in before you can comment on or make changes to this bug.