This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 918172 - File /usr/lib/jvm/java-1.7.0-openjdk- left after package removal
File /usr/lib/jvm/java-1.7.0-openjdk-
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: java-1.7.0-openjdk (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: jiri vanek
BaseOS QE - Apps
: 922910 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2013-03-05 11:09 EST by Lukas Zachar
Modified: 2013-04-23 01:49 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-04-23 01:49:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lukas Zachar 2013-03-05 11:09:49 EST
Description of problem:

The creation of the file classes.jsa has been added to the %post phase of the rpm (for its purpose see bug 513605 and bug 878181).
But the file is kept when the package itself is removed (as it is not owned by any package) and thus blocks the deletion of the directory tree.
IMHO the deletion should be managed by %postun (for the case of package removal). 
During the package update the file is regenerated, so no harm is done.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rpm -e java-1.7.0-openjdk
2. ls /usr/lib/jvm/java-1.7.0-openjdk-
Actual results:
The file and its directory tree is left after the removal.

Expected results:
No leftovers

Additional info:
Comment 1 jiri vanek 2013-03-14 06:04:24 EDT
damn. Yes this file have to be removed in postun, but only for removing of package, not for update. Because it is not "just regenerated" in post, but better "enriched" during post. So the fix in postun will be:

%ifarch %{jit_arches}
  if [ $1 -eq 0 ]
    if [ -f "$f" ]   
      rm -rf "$f"
Comment 2 jiri vanek 2013-03-18 07:02:44 EDT
Missing then. Otherwise QA is ok with this approach.

%ifarch %{jit_arches}
  if [ $1 -eq 0 ]
    if [ -f "$f" ]
      rm -rf "$f"
Comment 3 jiri vanek 2013-03-18 10:21:29 EDT
Ok one more update:

%ifarch %{jit_arches}
  if [ $1 -eq 0 ]
    if [ -f "$f" ]
      rm -rf "$f"

the usage of jrelnk instead of jredir is important to prevent inconsistency between update with/without changed buildversion (as release is not projected into final directory name)
Comment 4 jiri vanek 2013-03-22 11:12:04 EDT
*** Bug 922910 has been marked as a duplicate of this bug. ***
Comment 6 jiri vanek 2013-03-25 13:13:01 EDT
Builds with fix of this were pushed to fedora.
if they will pass theirs usual QA, I'm for inclusion into next CPU for Rhel
Comment 7 Nadav Har'El 2013-04-07 08:36:02 EDT
Have the same problem in Fedora: After the update *today* (two weeks after the above comment) to java-1.7.0-openjdk- I'm still left with the unowned file:

-r--r--r--. 1 root root 25M Mar 18 09:14 /usr/lib/jvm/java-1.7.0-openjdk-
Comment 8 jiri vanek 2013-04-08 03:25:42 EDT
Yes. They are left. It was my error, and I'm deeply sorry.
java-1.7.0-openjdk- *will* left.
But all *next*  eg:
java-1.7.0-openjdk- will not left enymore.

I do not want to add possibly unsafe scriplet which will remove old (== already not owned) file.

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