Bug 513224

Summary: ldconfig not called in %postun
Product: [Fedora] Fedora Reporter: Miroslav Lichvar <mlichvar>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: chkr, ffesti, jakub, jnovy, mtasaka, pmatilai, rdieter, schwab
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-25 08:43:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 510246    

Description Miroslav Lichvar 2009-07-22 15:39:10 UTC
Description of problem:
It seems that %postun -p /sbin/ldconfig is sometimes ignored (there is a check in runScript function if it's not redundant). This breaks updates of library that has not filenames in alphabetic order (or how ldconfig goes through the files).

For example when:
libfoo.0 -> libfoo.0.1beta
is updated to
libfoo.0 -> libfoo.0.1

In %post the symlink will be changed back to libfoo.0.1 and %postun won't be executed to fix it.

If this is actually a bug in ldconfig, please reassign.

Version-Release number of selected component (if applicable):
rpm-4.7.0-2.fc11

How reproducible:
Always

Steps to Reproduce:
1. replace /sbin/ldconfig with a script that logs its execution
2. update a library package
  
Actual results:
ldconfig not called

Expected results:
ldconfig called

Comment 1 Jindrich Novy 2009-08-04 10:05:38 UTC
Suspecting ldconfig here. Reassigning.

As a summary:
symlink:       libfoo.0 -> libfoo.0.1beta
is updated to: libfoo.0 -> libfoo.0.1

by ldconfig.

Comment 2 Andreas Schwab 2009-08-04 10:14:18 UTC
If ldconfig is not called, how can that be a bug in ldconfig?

Comment 3 Miroslav Lichvar 2009-08-04 10:28:59 UTC
ldconfig is always called in %post and it changes the symlink from libfoo.0.1 to libfoo.0.1beta, which would be fixed in %postun if ldconfig was called.

Comment 4 Andreas Schwab 2009-08-04 11:19:30 UTC
ldconfig always links to the newest version and libfoo.0.1beta is newer than libfoo.0.1, so the bug is that ldconfig is not called in %postun.

Comment 5 Miroslav Lichvar 2009-08-05 14:33:59 UTC
ldconfig has -X option which seems to disable the symlink modifications. Maybe we could start using /sbin/ldconfig -X in %post instead?

Comment 6 Mamoru TASAKA 2009-08-05 15:27:31 UTC
By the way this rpm "behaviour" caused bug 509635

Comment 7 Rex Dieter 2009-08-05 19:25:01 UTC
and bug #510246

Comment 8 Jakub Jelinek 2009-08-05 19:33:07 UTC
Except for forcefully downgrading rpms, newer rpms containing older SONAMEs sounds like a packager's bug to me.

Comment 9 Miroslav Lichvar 2009-08-05 19:48:34 UTC
SONAME stays the same, only the filenames differ.

In the bug #510246 calling ldconfig in %postun won't help, so I think there is nothing to fix in rpm.

The packages should just use -X.

Comment 10 Miroslav Lichvar 2009-08-05 21:34:53 UTC
Actually, to fix the problem in bug #510246 all packages would have to use -X in %post as the old libraries are removed after all %post have been run in a transaction.

The easiest solution would be probably to not replace symlinks to existing files in ldconfig by default.

Comment 11 Panu Matilainen 2010-01-25 08:43:11 UTC
As far as rpm not always calling ldconfig when it should, this has been fixed in rawhide for a while now. The issue is ages old and fairly rare, so no plans to fix it in F <= 12.