Find the answer to your Linux question:
Results 1 to 4 of 4
hi there, for some time we are having a curious problem on our RHEL system: let's say user1 is changing code and compiles everything in his environment. the executable binaries ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Location
    istanbul
    Posts
    1

    Question how to change shared library path on RHEL?


    hi there,

    for some time we are having a curious problem on our RHEL system:

    let's say user1 is changing code and compiles everything in his environment. the executable binaries are containing shared library links located in his environment. then a package containing the binaries and libraries is created.

    user2 takes the package and extracts it in his environment on the same machine. user2 uses LD_LIBRARY_PATH to correct the linked library paths to point on his extracted paths (which is correctly working on unix machines!).

    the problem is now that while user1 is still having its files we cannot change the linked library path for user2. ldd on a executable is still showing the library links to the libraries of user1. only if user1 deletes/moves his compiles files/libraries LD_LIBRARY_PATH is being considered by the processes in user2's environment.

    is there a possibility using another environment variables (or maybe a gcc compile option) to change this behaviour or at least the library search priority on RHEL?

    thanks and regards
    kgorgole

  2. #2
    Just Joined!
    Join Date
    May 2005
    Posts
    2
    Have you tried ldconfig or /etc/ld.so.conf

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by kgorgole View Post
    hi there,

    for some time we are having a curious problem on our RHEL system:

    let's say user1 is changing code and compiles everything in his environment. the executable binaries are containing shared library links located in his environment. then a package containing the binaries and libraries is created.

    user2 takes the package and extracts it in his environment on the same machine. user2 uses LD_LIBRARY_PATH to correct the linked library paths to point on his extracted paths (which is correctly working on unix machines!).

    the problem is now that while user1 is still having its files we cannot change the linked library path for user2. ldd on a executable is still showing the library links to the libraries of user1. only if user1 deletes/moves his compiles files/libraries LD_LIBRARY_PATH is being considered by the processes in user2's environment.

    is there a possibility using another environment variables (or maybe a gcc compile option) to change this behaviour or at least the library search priority on RHEL?

    thanks and regards
    kgorgole
    Hi,
    To be honest, I'm not really following your problem. However, it kind of sounds like you want the LD_PRELOAD env var maybe? Check out this StackOverflow thread on it. If that is not it, can you describe your problem in a little more specific detail?

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,533
    You can use the LD_LIBRARY_PATH environment variable, but it would be better to install the libraries in a known location, such as /usr/lib, /usr/lib64, etc (depending upon whether they are 32-bit or 64-bit). They should be found there by default. If not, then relink the executables after moving the libraries when creating your packages. Since this is RHEL, I assume you are building RPM files? The rpmbuild process is where this activity needs to take place.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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