Operating System - HP-UX
1848155 Members
8528 Online
104022 Solutions
New Discussion

SHLIB_PATH and LD_LIB_PATH

 
SOLVED
Go to solution
GBR
Regular Advisor

SHLIB_PATH and LD_LIB_PATH

I'm want to know as much about setting up both SHLIB_PATH and LD_LIB_PATH. E.g. Setting them up in .profile, setting them in /etc, etc...

Currently I'm working with an HP-UX D-Class server (D250, HP-UX 11.0, 32 bit, PA-RISC 1.1)

Give me your opinions.

GBR
5 REPLIES 5
Sundar_7
Honored Contributor
Solution

Re: SHLIB_PATH and LD_LIB_PATH


First of all, make sure your binary is set to use the SHLIB_PATH. If it is not, it will not even look for SHLIB_PATH !

Run the chatr command against the binary.

# chatr /usr/bin/ | grep SHLIB_PATH
SHLIB_PATH disabled second
#

If disabled, use the +s option with chatr to enable SHLIB_PATH lookup

# chatr +s enable /usr/bin/

Once enabled, SHLIB_PATH can be set in so many different ways. Either through .profile (if KSH or Posix) or through a wrapper script.

Sundar

Learn What to do ,How to do and more importantly When to do ?
GBR
Regular Advisor

Re: SHLIB_PATH and LD_LIB_PATH

How do I find the default shared library path?
Victor BERRIDGE
Honored Contributor

Re: SHLIB_PATH and LD_LIB_PATH

Hi,
under HPX you will use SHLIB_PATH the others are for other SVR4 unix (like SCO...)

The default will be /etc/SHLIB_PATH, it works very much the same as /etc/PATH, so depending what is installed it varies.
e.g.
it the beginning of live of this box(RP5450):
(Feb 2002) it was:
/usr/lib:/etc/opt/resmon/lib
since Dec 2004:
/usr/lib:/etc/opt/resmon/lib:/opt/mx/lib:/opt/mx/jre/lib/PA_RISC/native_threads:/opt/wlm/lib:/opt/gnome/lib

(I keep archives of what is on at a given date or before all product installation...)

All the best
Victor
Sundar_7
Honored Contributor

Re: SHLIB_PATH and LD_LIB_PATH

I don't beleive there is anything like default SHLIB_PATH.

I can tell you my understanding but I cannot assure you it is correct (given that I am no programmer :-).

If you dont have a SHLIB_PATH, at runtime, it will look for shared libraries that the binary was compiled with.

Learn What to do ,How to do and more importantly When to do ?
GBR
Regular Advisor

Re: SHLIB_PATH and LD_LIB_PATH

Thanks. Thread Closed.