Operating System - HP-UX
1833859 Members
3004 Online
110063 Solutions
New Discussion

How to get the list of shared libraries the process is using

 
Rajesh_36
Occasional Contributor

How to get the list of shared libraries the process is using

Is there a way to get the list of shared libraries a particular process is using?.

In Solaris we could use pmap to get that info.
Also, looking for a way to see all the environment variable used by the process.

Thanks
6 REPLIES 6
JohnWRuffo
Honored Contributor

Re: How to get the list of shared libraries the process is using

If you have access to a programming package (line Visual Studio or something) most of them have a debugger or system spy that can see whats going on.

Alternatively, you can execute the System Information (Start > Programs > Accessories > System Tools > System Information) and Click Software Environment / Loaded Modules and "try" to see the changes.
Enjoy!
__________________________________________
Was the post useful? Click on the white KUDOS! Star.

Do you need help with your HP product?
Try this: http://www.hp.com/support/hpgt
Cheryl Griffin
Honored Contributor

Re: How to get the list of shared libraries the process is using

Use chatr to examine the process:
# ps -ef |grep envd
root 1603 1 0 Dec 5 ? 0:00 /usr/sbin/envd

# chatr /usr/sbin/envd
/usr/sbin/envd:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libc.2
... snip
"Downtime is a Crime."
Jean-Luc Oudart
Honored Contributor

Re: How to get the list of shared libraries the process is using

As mentioned, you can use chatr to see the list of shred lib for the program. Of course if SHLIB_PATH is enabled, you understand path for the shared library may change at execution depending on the value of the environment variable.
If the process is running, you can use glance (select process, Open file option) you may either have the path to the file or inode within the logical volume.

If you don't have glance you can use "lsof"

regards,
Jean-Luc
fiat lux
Zeev Schultz
Honored Contributor

Re: How to get the list of shared libraries the process is using

I also like using 'ldd '.
Of course you need to know the binary name
for this which I assume you get from 'ps' output.Chatr is also good to show build options for the binary.Pmap is from Solaris 2.7 afaik, but ldd is there also,isn't it?
So computers don't think yet. At least not chess computers. - Seymour Cray
Jan van den Ende
Honored Contributor

Re: How to get the list of shared libraries the process is using

Somehow I got here via "Business related issues", and in itself the question looks interesting, but the answers are not really looking like effective ( on OpenVMS systems that is :-) ).
For VMS, do
$ ANALYZE/IMAGE/INTERACTIVE .

one page at a time you get info about the image.
Look for the chapter: "Shareable Image List", and here is your answer.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Sundar_7
Honored Contributor

Re: How to get the list of shared libraries the process is using


You can use ldd, chatr and lsof to find the shared libaries used by a particular binary.

lsof will only work on a process that is currently running.

ldd and chatr can be used against binaries.
Learn What to do ,How to do and more importantly When to do ?