LinuxQuestions.org
Review your favorite Linux distribution.
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, 01:09 AM   #1
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Rep: Reputation: 0
use of "ldd" in live production server


Hi,
I am new to solaris.
Can we use ldd command on live production server
please help me out.

Last edited by Amrita@3086; 03-29-2007 at 01:23 AM.
 
Old 03-29-2007, 01:13 AM   #2
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
Yes, why not?

ldd just tells You which libraries are needed for specific binary:
Code:
% ldd `which fluxbox`
/usr/local/bin/fluxbox:
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x2819c000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x281a6000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x281c0000)
        libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x282b0000)
        libfontconfig.so.1 => /usr/X11R6/lib/libfontconfig.so.1 (0x282c9000)
        libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x282f7000)
        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x2831a000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x28324000)
        libImlib2.so.4 => /usr/local/lib/libImlib2.so.4 (0x2833a000)
        libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x283b4000)
        libz.so.3 => /lib/libz.so.3 (0x28437000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x28448000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x2852d000)
        libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x2853d000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x28541000)
        libm.so.4 => /lib/libm.so.4 (0x28617000)
        libc.so.6 => /lib/libc.so.6 (0x2862d000)
It is VERY useful in server environment to check for example which libraries are needed by apache to copy them to chroot environment to make it work correctly.
 
Old 03-29-2007, 01:32 AM   #3
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks Vermaden,

$ ldd bin/engine
libCNTI.so => /opt/CommerceLink/clnkvisa/lib/libCNTI.so
libopenssl.so => /opt/CommerceLink/clnkvisa/lib/libopenssl.so
libcssl.so => /opt/CommerceLink/clnkvisa/lib/libcssl.so
libiodbc.so.2 => /usr/local/lib/libiodbc.so.2
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libstdc++.so.2.8.1.1 => /usr/lib/libstdc++.so.2.8.1.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1

here libCNTI.so is pointing to /opt/CommerceLink/clnkvisa/lib/libCNTI.so
but according to our application it should point to some other object
like libCNTIbbk.bm.so

is it possible that ldd is not pointing to correct .so file
can you please help me out ?

Last edited by Amrita@3086; 03-29-2007 at 01:35 AM.
 
Old 03-29-2007, 02:13 AM   #4
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
If it points to an unexpected library, then the reason could be a messed LD_LIBRARY_PATH, however, libCNTI.so cannot point to a library with a different name, like libCNTIbbk.bm.so.
 
Old 03-29-2007, 02:33 AM   #5
Amrita@3086
LQ Newbie
 
Registered: Mar 2007
Posts: 18

Original Poster
Rep: Reputation: 0
hi,
bin/engine is suppose to use
libCNTIbbk.bm.so, but

after running
$ldd bin/engine
It is showing that is using libCNTI.so

Is there any way to find ?"libCNTIbbk.bm.so" library is used
by which executable

Thans in advance.
 
Old 03-29-2007, 05:09 AM   #6
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
Quote:
Originally Posted by Amrita@3086
here libCNTI.so is pointing to /opt/CommerceLink/clnkvisa/lib/libCNTI.so
but according to our application it should point to some other object like libCNTIbbk.bm.so

is it possible that ldd is not pointing to correct .so file
can you please help me out ?
check Your /etc/ld.so.conf for libCNTIbbk.bm.so and libCNTI.so:
Code:
% grep 'libCNTIbbk.bm.so\|libCNTI.so' /etc/ld.so.conf

also check if libCNTI.so is not only a symlink:
Code:
% ls -l /opt/CommerceLink/clnkvisa/lib/libCNTI.so
 
Old 03-29-2007, 05:16 AM   #7
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
Quote:
Originally Posted by Amrita@3086
Is there any way to find ?"libCNTIbbk.bm.so" library is used by which executable
like that for example:
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

Last edited by vermaden; 03-29-2007 at 05:17 AM.
 
Old 03-29-2007, 05:56 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
[QUOTE=vermaden]check Your /etc/ld.so.conf for libCNTIbbk.bm.so and libCNTI.so:
Code:
% grep 'libCNTIbbk.bm.so\|libCNTI.so' /etc/ld.so.conf
Unlike linux there is no /etc/ld.so.conf in solaris. There is
Code:
crle
to view and set the path to the various libraries

Regards
 
Old 03-29-2007, 06:40 AM   #9
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
Quote:
Originally Posted by bathory
Unlike linux there is no /etc/ld.so.conf in solaris. There is
Code:
crle
to view and set the path to the various libraries
Good to know, I do not use Linux either, maybe sometimes under /usr/compat/linux
 
  


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
Where do "Admin" and "User" guides live? Swan1 SUSE / openSUSE 1 07-07-2006 12:53 PM
would you go "unstable" in a production environment? garba Debian 4 01-05-2006 10:02 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
Does "ac97 & RH8" imply "buy a Sound Blaster Live"? nicktoop Linux - Hardware 3 02-13-2004 08:53 AM
What is "Xlib: connection to ":0.0" refused by server " rack201 Linux - Software 1 02-04-2004 07:49 AM

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

All times are GMT -5. The time now is 06:07 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