/etc/ld.so.conf.d

Nils Philippsen nphilipp at redhat.com
Thu Mar 18 12:18:23 UTC 2004


On Thu, 2004-03-18 at 09:53, Roland McGrath wrote:
> 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.

I like the idea, but there are some things that I think need to be
considered when doing it:

I think we'd need to somehow be able to influence the order in which
files from /etc/ld.so.conf.d are drawn. Perhaps the files in there
should be named something like ${prio}-${name}.conf, e.g.
'50-xorg-x11.conf'. The question is what to do when the admin wants to
change the ordering -- when renaming the file, it isn't covered by
package management any longer. Perhaps encoding the ordering/priority in
the file itself might do the trick, but that opens just another can of
worms on the implementation side.

Nils
-- 
     Nils Philippsen    /    Red Hat    /    nphilipp at redhat.com
"They that can give up essential liberty to obtain a little temporary
 safety deserve neither liberty nor safety."     -- B. Franklin, 1759
 PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20040318/e21cf4ca/attachment.sig>


More information about the fedora-devel-list mailing list