LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-17-2012, 07:40 PM   #1
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
smart way for caching libraries with ldconfig


hi ,

i'm looking for a smart way to have ldconfig recursively search and cache all libraries that it finds in a particular directory.

this is because not all libraries are set in previously known locations .

for instance , libraries might be in /usr/lib/<application-name>/libxxx
that are not known prior to installation , and i want this to be automated which means i can't afforf manually editing ld.so.conf for each and every library or app that's being installed

i want for instance ldconfig to cache all libraries in /usr/lib/* INCLUDING SUBDIRECTORIES !!!
is there a special syntax for ld.so.conf files ?


thanks in advance

Last edited by entz; 01-19-2012 at 12:00 PM.
 
Old 02-18-2012, 03:50 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Should you really?..

Quote:
Originally Posted by entz View Post
i want for instance ldconfig to cache all libraries in /usr/lib/* INCLUDING SUBDIRECTORIES !!!
is there a special syntax for ld.so.conf files ?
See 'man ldconfig': the part about "trusted directories".


Quote:
Originally Posted by entz View Post
for instance , libraries might be in /usr/lib/<application-name>/libxxx that are not known prior to installation , and i want this to be automated which means i can't afforf manually editing ld.so.conf for each and every library or app that's being installed
The preferred way is to drop a configuration file in /etc/ld.so.conf.d/ containing just the name of the subdirectory. It doesn't mean you should cache each and every library found in /usr/lib subdirectories though.


Should you want to do it anyway (*shrug*, your fault, not mine) you can use something like:
Code:
find /usr/lib -type f | while read LIBFILE; do
 file "${LIBFILE}"|grep -q 'shared object' && ( ldconfig -p|grep -q $(basename "${LIBFILE}")||echo $(dirname "${LIBFILE}") )
done | sort -u > /etc/ld.so.conf.d/IDoWhateverIwantEvenIfNotAdvisable

//NTLB
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldconfig: unable to add libraries samrat_rao Linux - Software 3 08-11-2011 04:19 AM
Thread limits in dynamic libraries as opposed to static libraries pmkenny1234 Linux - Software 0 04-26-2011 02:22 PM
Smart's gui is not so smart right now... litlmary SUSE / openSUSE 6 01-27-2007 02:05 AM
Smart problem adding new channel in Smart-beta google01103 SUSE / openSUSE 1 11-21-2006 07:17 AM
ldconfig message during libraries install with deb pascalv Linux - Software 0 07-12-2005 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration