Re: Bug#72140: Setting up libraries too slow
On Thu, 21 Sep 2000, Henrique M Holschuh wrote:
> > The only point in running ldconfig today is to update the symlinks, which
> > could also be done by a few "ln"s in "if" statements. I think there should
> > be an update-lib-symlinks(8) that handles installation and removal of
> > libraries.
> What about ld.so's cache? Isn't ldconfig the one responsible to keep that
> thing up-to-date?
Well, our university lab lets users install software into /usr/local/, and
though noone runs ldconfig on those systems, it still works (see below for
exceptions). The cache is updated automatically, the first time a library
is used, it has to be searched for, but this is done by trial-and-error
and not by reading the directory listings, so it is sufficiently fast
(read: not noticable). Cache removals are handled the same way, if opening
the library fails, the entry is removed from the cache.
It is a good thing to call ldconfig occasionally (perhaps in a cron
job) on systems where software gets installed in /usr/local and libraries
there are supposed to mask libraries in /lib or /usr/lib. On those
systems, the cache points to the distro's version, and /usr/local/lib
isn't searched in. The loader is somewhat broken here, it should update
the cache when the directory changes.
You see, we could drop ldconfig entirely (like the NetBSD folks have done
already), if someone would fix ld.so to invalidate the caches
properly. Until then, we could call ldconfig nightly and/or add a setuid
wrapper program that allows a normal user to rebuild the cache if
he/she/it installed new libraries that mask distro provided libraries.
PGP public key available from http://phobos.fs.tum.de/pgp/Simon.Richter.asc
Fingerprint: 10 62 F6 F5 C0 5D 9E D8 47 05 1B 8A 22 E5 4E C1
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!