/etc/ld.so.conf.d

Roland McGrath roland at redhat.com
Thu Mar 18 08:53:38 UTC 2004


Earlier in the day I was moved by the plight of a developer trying to
figure out exactly how his rpm postinstall/postuninstall scripts should
edit /etc/ld.so.conf for the directories they install libraries in.
I think a good answer is that they shouldn't have to do that.

I just implemented an `include' feature with globbing in ldconfig's
configuration file parsing.  (This will be in an unspecified future glibc
rpm coming to you in rawhide in the fullness of time.)  I propose that in
future the canonical /etc/ld.so.conf contain just:

include ld.so.conf.d/*.conf

A relative file name in an include is relative to the containing file's
directory, so that means /etc/ld.so.conf.d/*.conf will be taken together as
the effective contents of /etc/ld.so.conf.

/etc/ld.so.conf.d/foobar.conf can then be installed by the foobar package
as a normal file, and its postinstall/postuninstall doesn't need to touch
anything before it runs ldconfig.  Note that it doesn't hurt to have the
same directory appear multiple times (ldconfig just ignores the
duplicates), so each package foobar installing foobar.conf containing
(e.g.) /usr/X11R6/lib is ok.  OTOH, it would also be possible to have all
such packages install /etc/ld.so.conf.d/X11R6.conf with identical contents
and have the rpm magic take care of it that way.  Others know better than I.


Thanks,
Roland





More information about the fedora-devel-list mailing list