[nycbug-talk] FreeBSD ldconfig, subdirectories

Charles Sprickman spork at bway.net
Thu Nov 12 00:23:35 EST 2009

On Wed, 11 Nov 2009, Hans Zaunere wrote:

>> I have a workaround for this, but I'm curious about a detail that I'm
>> missing...
>> I've setup a 32-bit jail on a 64-bit host.  It works.  However, I see that
>> some local libraries from ports/packages end up in subdirectories (ie:
>> /usr/local/lib/mysql).  This seems to be normal based on what I've seen on
>> other hosts.
>> However I have some subdirectories in one of my "lib32" search paths and
>> none of the libs in the subdirectories get added (confirmed with "ldconfig
>> -32 -r").
> I've had a terrible time getting FreeBSD's ldconfig look through the
> directories I tell it, recursive or not.  On Linux it's a simple .conf
> directive, but I've yet to find anything but symlink and similar hacks in
> FreeBSD.  The documented .conf settings don't appear to have an effect.

I have no problems with it scanning the appropriate directories using the 
rc.conf knobs (ie: ldconfig_paths="/usr/lib/compat /usr/X11R6/lib 
/usr/local/lib /usr/local/lib/compat/pkg").  The only time I've had to 
resort to symlink hackery is when I'm doing something I shouldn't like 
bringing a foreign binary in that's linked against a different version of 
some shared lib.  Symlink to the one I've got, whoo!

>> I can find no documentation explaining when ldconfig descends into
>> subdirectories and when it does not.  Can anyone point me in the right
>> direction?
> Unfortunately no, except to keep things in pre-determined system paths.

It's terribly puzzling.  In the main host I see "/usr/local/lib" set in 
ldconfig_paths, and I see libs that live in subdirectories in "ldconfig 
-r" output.

Oh, hold up...  I'm onto something.  In a fresh jail I installed the mysql 
client.  "ldconfig -r" shows the libs, and they live in 
/usr/local/lib/mysql.  The install did not add anything to rc.conf.  I do 
see that the installer ran "ldconfig -m /usr/local/lib/mysql".  I also see 
a file that contains the string "/usr/local/lib/mysql" was added to 
the /usr/local/libdata/ldconfig directory.  Never seen that directory 
before, don't see it referenced in /etc/rc.d/ldconfig.  Surely the answer 
is near, something scans that directory at startup and sets additional 
paths for ldconfig...


> H

More information about the talk mailing list