Bug 525051 - alternatives can leave dangling symlinks after removal of manually set alternative's package
Summary: alternatives can leave dangling symlinks after removal of manually set altern...
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: chkconfig
Version: 5.4
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Bill Nottingham
QA Contact: BaseOS QE
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-23 06:53 UTC by David Tardon
Modified: 2016-05-03 11:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-12-02 12:15:27 UTC
Target Upstream Version:

Attachments (Terms of Use)
a fix (631 bytes, patch)
2009-09-23 06:54 UTC, David Tardon
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1628 0 normal SHIPPED_LIVE chkconfig bug fix update 2009-12-02 12:15:13 UTC

Description David Tardon 2009-09-23 06:53:40 UTC
Description of problem:
If one sets an alternative for something to the _last_ available item
and then uninstall the package offering that alternative, then that
something is not changed to the best available alternative as expected,
leaving dangling symlinks and an unusable program(s).

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

How reproducible:

Steps to Reproduce:
1. remove all installed java-devel packages
1. yum install java-1.4.2-gcj-compat-devel
2. yum install java-1.6.0-openjdk-devel
3. alternatives --config javac, select the _last_ item
   (should be /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac)
4. alternatives --display javac | head -n2
   (status manual, link points to /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac)
5. yum remove java-1.6.0-openjdk-devel
6. alternatives --display javac | head -n2
   (status manual, link points to /usr/lib/jvm/java-1.6.0-openjdk*/bin/javac--wrong!)
Actual results:
Dangling symlinks.

Expected results:
Symlinks are restored to point to the best available alternative.

Additional info:
Source code looks the same in Fedora Rawhide version, so I presume the
same bug is present there (I haven't checked it).

Comment 1 David Tardon 2009-09-23 06:54:23 UTC
Created attachment 362177 [details]
a fix

Comment 4 Bill Nottingham 2009-11-02 19:27:51 UTC
Building as

Comment 6 Martin Cermak 2009-11-19 15:14:52 UTC
I created a RHTS test for this bug (/CoreOS/chkconfig/Regression/bz525051-alternatives-can-leave-dangling-symlinks-after). The test passed on architectures that provide the package java-1.6.0-openjdk-devel. These are i386 (server, client), x86_64 (server, client). On architectures s390x, ppc64 and ia64 currently only java 1.4 is provided. I consider this chkconfig test as successful.

Comment 9 errata-xmlrpc 2009-12-02 12:15:27 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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