Running ldconfig in RPM %post scripts

I tripped over this today.

I had a RPM file that included a run of /sbin/ldconfig in its %post section. This has been fine for months.

And then it wasn't fine any more. Someone did a downgrade.

The trouble here is that %post is run before the now unused files from the outgoing package are removed.

To illustrate the trouble this can cause, consider this scenario. Package foo-1.2 includes This is referenced as

All fine and normal so far. But in foo-1.3, the library is updated to Install foo-1.3, and the library is updated and everything works.

Now downgrade back to foo-1.2. foo-1.2 is installed, its contents unpacked, and its %post runs ldconfig. Because the old files are not removed, ldconfig creates as pointing to the latest actual library, which at this stage is still %post completes, and the outgoing package files are then deleted and its %postun run. Suddenly that link is dangling.

The only solution I've found so far is to also run ldconfig in the outgoing package %postun section.

ldconfigandrpm.txt · Last modified: 2012/02/16 17:09 by jim = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0