From Fedora Project Wiki


Removing ldconfig scriptlets

Summary

For many years, package maintainers were required to write scriptlets which call ldconfig in %post/%postun if they package shared libraries.

Owner

Current status

Detailed Description

Since time immemorial, Red Hat/Fedora packagers have been required to add a stanza to spec files for packages containing libraries to update the ldconfig cache.

%post -p /sbin/ldconfig    
%postun -p /sbin/ldconfig

To say this is annoying is to put it mildly. However, there was no standard mechanism to make this boilerplate go away. Now with RPM 4.13+, we should change this to file triggers and make all of that go away.

With this change, these scriptlets can be removed and ldconfig would be run just once per transaction.

If your package places shared libraries in special locations referenced by ld.so.conf, you still need to run ldconfig manually.

For those who concerned about whether this is self-contained or system-wide change: there is no overhead if packagers don't remove ldconfig scriptlets in time, so completion doesn't depend whether packagers remove them or not. We are just making it possible.

Benefit to Fedora

  • Packagers don't need to write ldconfig scriptlets anymore (often they forget to).
  • Significantly faster installation of packages.

Scope

  • Proposal owners:
  • Other developers: Package maintainers are advised to remove ldconfig scriptlets in order to achieve benefits specified above.
  • Release engineering: #7284 (a check of an impact with Release Engineering is needed)
  • Policies and guidelines: Packaging guidelines need to be updated to reflect reality.
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

Packagers who want to support only Fedora 28+ in their spec files can remove scriptlets entirely. For the rest, they should switch to use newly created macros.

Spec file should use %ldconfig_post, %ldconfig_postun, or preferably, %ldconfig_scriptlets.

  • %post -p /sbin/ldconfig%ldconfig_post
  • %postun -p /sbin/ldconfig%ldconfig_postun
  • %post -p /sbin/ldconfig + %postun -p /sbin/ldconfig%ldconfig_scriptlets
  • Simple /sbin/ldconfig line in %post/%postun%?ldconfig


How To Test

  1. Make sure you have latest glibc and redhat-rpm-config
  2. Find package which packages shared library
  3. Remove ldconfig scriptlets
  4. Build package
  5. Install package
  6. Test that dependent applications work

User Experience

Installation of packages is significantly faster.

Dependencies

N/A (not a System Wide Change)

Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?) N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change), Yes/No
  • Blocks product? product

Documentation

N/A (not a System Wide Change)

Release Notes