Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm curious as to how other Linux admins manage /etc/ld.so.conf and in general, shared libraries across multiple Linux servers.

We have about 30-40 Linux servers running SLES 11. Since they are tied to Active Directory, users can log into any server with their same credentials. Originally, each server had its own local ld.so.conf. However, we ran into issues where a specific piece of software, php for example, would run on server X but crash on server Y because a sys admin rearranged ld.so.conf on server Y. We strive for consistency across servers so users can easily use any number of servers for load balancing. There are certain servers that have specific purposes of course though.

We thought symlinking to a shared ld.so.conf with a script that goes out and runs ldconfig on all servers whenever a change is made. I thought it would bring consistency across all servers, but I see how some servers would need a custom ld.so.conf because it runs different software that may need a different lib version.

I've only been a Linux admin for under three years, so this may be a simple answer for some, so just looking for advice on this topic. Questions that came to mind:

  • local or symlinked /etc/ld.so.conf?
  • clean out old versions of shared libs if multiple versions exist in different lib directories?
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Normally user or rather app related configurations should be in the:

/etc/ld.so.conf.d

and included from /etc/ld.so.conf. Which can be identical across all servers and should not be touched

This way your management becomes easier by simply making the directory /etc/ld.so.conf.d/ consistent across all of your servers.

You can probably come up with a simple rsync script that will do this for you.

share|improve this answer
    
Good info, thanks. One issue I ran into is a server that is running ntop. Ntop needs newer versions of a specific shared lib, and these newer versions are in /usr/local/lib. The older versions are in /usr/lib, and ntop crashes when using the old versions. Is there a way to have ntop look at /usr/local/lib FIRST before /usr/lib? Right now, I have a local ld.so.conf that I rearranged to make ntop happy. But per your answer, I don't want to change ld.so.conf. How would ntop know to load a specific config in ld.so.conf.d? Maybe I'm not understanding how its used by apps. –  Banjer Mar 7 '12 at 14:56
1  
@Banjer Use LD_LIBRARY_PATH environment variable in the start script instead. Or install ntop that comes with the distribution it should be properly integrated with libraries distributed. –  Karlson Mar 7 '12 at 15:44
    
Creating a "wrapper" script that sets LD_LIBRARY_PATH and then calls the program is a good idea. This should take care of any wacky programs out there that don't like our ld.so.conf. –  Banjer Mar 7 '12 at 20:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.