Find the answer to your Linux question:
Results 1 to 1 of 1
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Some questions about ldconfig and ldd

    I have no problems updating my search file and I have no problems specifying .conf files to be picked up and used in the directory. After I change a path in one or more of the .conf files in, I simply run ldconfig and the cache updates. I can save the output to a text file, read it, and understand that the libraries are now properly found.

    The problem that I have is that when an application runs, the application will still pick up the older versions even though they are listed AFTER my new configuration in the cache. I just want to know what the best strategy is to combat this. Changing LD_LIBRARY_PATH would help IF it's searched BEFORE the cache, but to my knowledge it is not. So my questions are:

    1) Can I get the proper shared libraries to load when I run the executable using some variant on the app's command line, such as -L and -l. I've tried those so far with no luck, or some variant on how I had ldd use the cache? The cache DOES have all the correct libraries since I gave it my custom app's path in the apps.conf file. I simply used the multi-arch file and modified it appropriately. In general, I could use a separate file but that was a convenient place to do it. Or should I create a .conf file that is more app-specific - I wouldn't think this would matter.

    2) Is it ok to leave the cache with the modifications, or to be safe, should I reset it to it's original state. I can do this simply by hiding the file with hideconf, so when ldconfig runs on next boot, it will be sure to load the operating system correctly.

    I have only spent this morning on the issue, I can try some other mixes of ideas, but if there is some way to have the loader understand that I want the first mentioned path to be used, not the "trusted" paths.

    3) A last questions I have is, is it ok to have more than version of a shared library loaded into memory at the same time? And is this part of the problem? The OS uses one version, and my app uses a different one.

    My application will run if I do a bunch of configuring and exit 0 but it uses the old libraries in fulfilling it's shared library needs, which is not what I want. I want to use a particular set of shared libraries.

    I remember last week trying the ldconfig with various options such as -n and -X which I know can skip the trusted directories but I guess that's not exactly what I want when the cache builds. I want them to be there, I just want
    the app to use the ones earlier in the file, which are the ones the application wants to use.

    I read once on a separate forum or thread that the order of's search is as follows so I should be able to short-circuit ld to find the right libs (notice the order below):

    directories from LD_LIBRARY_PATH;
    directories from /etc/;

    I had written a short .sh file and did not call it today - I'll at least give that a try, but something tells me the app will run but on the old libraries again - but here goes, I'll try it. Maybe it will work?
    Last edited by LinuxBeatsMe; 11-13-2018 at 04:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts