LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-29-2007, 04:19 AM   #1
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Rep: Reputation: 0
is there any way to find which executable is using a paricular ".so" file


Hi,
Is there any way to find ?
a particular library(".so" file) is used by which executable?

Thanks in advance

Last edited by Amrita@3086; 03-29-2007 at 04:20 AM.
 
Old 03-29-2007, 04:21 AM   #2
Vikas Jayna
LQ Newbie
 
Registered: Mar 2007
Location: Noida, Delhi (NCR), India
Distribution: Fedora
Posts: 11

Rep: Reputation: 0
Check out the lsof command

Code:
lsof -p <process id>
 
Old 03-29-2007, 04:30 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
You can do the reverse: find which executable is using which .so file, if that's any use?...
Code:
ldd /usr/bin/vim
will show you which shared library dependencies vim has.
 
Old 03-29-2007, 04:30 AM   #4
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Original Poster
Rep: Reputation: 0
hi Vikas,
I have checked man page for lsof
But there is no entry for it
 
Old 03-29-2007, 04:33 AM   #5
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Original Poster
Rep: Reputation: 0
hi pwc101,
I have done that, but i am not getting the expected
".so" file. that's why i am thinking in reverse way.
 
Old 03-29-2007, 05:08 AM   #6
Vikas Jayna
LQ Newbie
 
Registered: Mar 2007
Location: Noida, Delhi (NCR), India
Distribution: Fedora
Posts: 11

Rep: Reputation: 0
Hi Amrita,

In case u dont have lsof installed, u can go thru the online man page at http://www.die.net/doc/linux/man/man8/lsof.8.html

Notice that when lsof is run without giving any filename it lists all open files belonging to all active processes and u can grep the output to locate the .so file ur looking for

lsof | grep 'xyz.so'
 
Old 03-29-2007, 05:34 AM   #7
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Unless you're running as root, you might not have lsof in your PATH, so might be worth doing a
Code:
locate lsof
and finding the binary. Mine on RHEL4 was /usr/sbin/lsof.
 
Old 03-29-2007, 05:38 AM   #8
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
Code:
% for binary in /bin/* /sbin/* /usr/local/bin/* /usr/local/sbin/* /put/other/path/here/bin/* ;do if [ ! $(ldd `which ${binary}` | grep -q libCNTIbbk.bm.so) ]; then echo ${binary} ;fi ;done
to check which binaries use libCNTIbbk.bm.so
 
Old 03-29-2007, 05:42 AM   #9
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Quote:
Originally Posted by vermaden
Code:
% for binary in /bin/* /sbin/* /usr/local/bin/* /usr/local/sbin/* /put/other/path/here/bin/* ;do if [ ! $(ldd `which ${binary}` | grep -q libCNTIbbk.bm.so) ]; then echo ${binary} ;fi ;done
to check which binaries use libCNTIbbk.bm.so
Very cunning!
 
Old 03-29-2007, 08:23 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
lsof isn't bundled with Solaris.
 
Old 03-29-2007, 03:40 PM   #11
wpn146
Member
 
Registered: Jan 2005
Distribution: Solaris, Linux Fedora Core 6
Posts: 170

Rep: Reputation: 30
The "lsof" package can be found on www.sunfreeware.com
 
  


Reply



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
giving search-string(s) from a file to linux "find" command Fond_of_Opensource Linux - Newbie 3 02-02-2009 06:14 PM
gdb "not in executable format: File format not recognized" tcma Programming 9 07-18-2007 06:02 AM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM
Where can I find the "patch" executable ? chatguy Linux - Newbie 4 03-15-2004 01:32 AM
Pre-Build Executable "No Such File or Directory" problem Archeress Linux - General 2 08-17-2002 08:26 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:24 AM.

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