Operating System - HP-UX
1830940 Members
1788 Online
110017 Solutions
New Discussion

Re: Why does running the binary online work but not in script?

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

Why does running the binary online work but not in script?

Hi,

Server: HP-UX 11.0 OVO 7.1 Oracle 8.1.7.2

I can successfully run an executable online, however when I run the same binary in a script
it fails. The error messages are this:

root# $OMNIHOME/probes/hpux11/nco_p_vpo
+ /opt/netcool/omnibus/probes/hpux11/nco_p_vpo
/usr/lib/dld.sl: Can't find path for shared library: libintl_r.sl
/usr/lib/dld.sl: No such file or directory
./netcool_probe[25]: 8284 Abort(coredump)

In the script I have the path for the library
it is looking for (libintl_r.sl) in the $PATH.
I also have the path for "/usr/lib"
I set an echo in the script and I can see
both path's that mentioned as set in the
$PATH env variable.

Note: That library (libintl_r.sl) is a symbolic link to another file in the same directory.

Any ideas?

10 points to any good answer.
Thank you
Gino
7 REPLIES 7
Mark Grant
Honored Contributor
Solution

Re: Why does running the binary online work but not in script?

How about setting LD_LIBRARY_PATH to point to the directory containing the library.
Never preceed any demonstration with anything more predictive than "watch this"
Gino Castoldi_2
Honored Contributor

Re: Why does running the binary online work but not in script?

Hi,

I tried setting LD_LIBRARY_PATH and it failed
with the same errors as before.

10 points to any good answer.
Thank you
Gino
Mark Greene_1
Honored Contributor

Re: Why does running the binary online work but not in script?

You also need the following environment variables set:

LD_LIBRARY_PATH=/oracle/products/9.2.0/lib
SHLIB_PATH=/oracle/products/9.2.0/lib
LIBPATH=/oracle/products/9.2.0/lib


The above examples are for Oracle 9.2; I don't know what the correct directories are for your implementation.

mark
the future will be a lot like now, only later
Donny Jekels
Respected Contributor

Re: Why does running the binary online work but not in script?

Gino,

usually, when you run tools as root in a script the shell invokes a subshell. however you need to provide the subshell with the correct variables, the same as your own shell.

check your environment, use #env
then make sure you include those in the top of your script.

the easiest is to source root's .profile

. /root/.profile

peace
Donny
"Vision, is the art of seeing the invisible"
Gino Castoldi_2
Honored Contributor

Re: Why does running the binary online work but not in script?

Hi everyone,

I set SHLIB_PATH to the "missing" directory and now it works.

Thank you for all your help!
Gino

Leonardo Sanchez
New Member

Re: Why does running the binary online work but not in script?

somebody knows with what package nco_p_vpo comes? I navigate insite ibm site, but only found nnm probe.
Steven Schweda
Honored Contributor

Re: Why does running the binary online work but not in script?

For examples of what can go wrong when you
set these environment variables in general
locations (like "$HOME/.profile"), see:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1067213

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1067351

If you have a program which needs to have
these things set, it's often safer to use a
script which first sets the variables, and
then runs the program.

Special settings which are good for one program
are often not so good for other programs.