Author |
Message
|
crazyleya |
Posted: Tue May 23, 2006 12:01 pm Post subject: Cannot run sqlplus from my trigger program |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
I have MQ 5.3.
I have a script that is triggered on arrival of a message. I am trying to run sqlplus in the script. I get this error "ld.so.1: sqlplus: fatal: libclntsh.so.9.0: open failed: No such file or directory
Killed"
When I run the same script from the shell, it runs without any problem.
The following is the env echoed from inside the script.
CLASSPATH=/apps/all_adm/scripts/MQTrigger:/opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/connector.jar
DISPLAY=10.198.143.19:0.0
HOME=/apps/all_adm
LD_LIBRARY_PATH=/apps/oracle/9.2.0.4/lib:/opt/mqm/java/lib
LOGNAME=all_adm
ORACLE_HOME=/apps/oracle/9.2.0.4
ORACLE_SID=O1SWFNYT
PATH=/usr/bin::/etc:/opt/EMCpower/bin/sparcv9:/etc/emc/bin:.:/apps/oracle/9.2.0.4/bin
PWD=/apps/all_adm
SHELL=/bin/ksh
TERM=xterm
TNS_ADMIN=/apps/oracle/9.2.0.4/network/admin
USER=all_adm
WINDOWID=4194317
_=/usr/bin/runmqtrm
Can someone please help me? Thanks |
|
Back to top |
|
 |
mvic |
Posted: Tue May 23, 2006 1:36 pm Post subject: Re: Cannot run sqlplus from my trigger program |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
This is what I have for runmqtrm (on AIX, for what it's worth):
Code: |
$ ls -l /usr/mqm/bin/runmqtrm
-r-sr-s--- 1 mqm mqm 33730 21 Oct 2005 /usr/mqm/bin/runmqtrm |
Unless I am much mistaken, LD_LIBRARY_PATH is (or should be) ignored when running from setuid programs. Perhaps this is the reason for what you are seeing.
One other thing; when you said
Quote: |
The following is the env echoed from inside the script. |
did you mean that you had run
Code: |
/usr/bin/ksh -c export |
as the triggered app? The reason I ask is that I am not sure what environment applies in processes started from runmqtrm.
Hope this helps |
|
Back to top |
|
 |
crazyleya |
Posted: Tue May 23, 2006 5:30 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
I put an env inside the script. I guess the LD_LIBRARY_PATH is being used. I have a java program being called inside the script. If I remove the /opt/mqm/lib from the LD_LIBRARY_PATH, the java program throws an exceptions. |
|
Back to top |
|
 |
crazyleya |
Posted: Tue May 23, 2006 5:33 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
If LD_LIBRARY_PATH is indeed the problem how will I work around the problem. I need /apps/oracle/9.2.0.4/lib in LD_LIBRARY_PATH for sqlplus to run. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 23, 2006 6:23 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What user is starting runmqtrm?
There's a FAQ about triggering, too. It might help. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
crazyleya |
Posted: Tue May 23, 2006 7:17 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
It is a user called app_admin. Not mqm |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 23, 2006 7:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
crazyleya |
Posted: Wed May 24, 2006 3:12 am Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
I tried using two scripts as mentioned in the ppt. It didn't help |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed May 24, 2006 3:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
crazyleya wrote: |
I tried using two scripts as mentioned in the ppt. It didn't help |
Design phase : do not remove the script after completion but keep it.
Now try to log in with the user running the trigger monitor and execute the script manually. See what errors you get. Once everything is fixed you may set the script to remove the file again.
This may well be some permissions problem and have nothing to do with the script. Make sure the user running the script has all the right group memberships to be allowed to execute both stuff in mq and in oracle. Remember to grant access to all needed oracle "packages".
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 24, 2006 4:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Is runmqtrm being started by CRON, or manually? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Wed May 24, 2006 4:46 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
so, which unix is this? Is /etc/ld.(so.)conf an option instead of LD_LIBRARY_PATH? _________________ -wayne |
|
Back to top |
|
 |
crazyleya |
Posted: Wed May 24, 2006 9:40 am Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
It's solaris 5.9. I'm starting the trigger manually. |
|
Back to top |
|
 |
crazyleya |
Posted: Thu Jun 01, 2006 4:57 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 9
|
It was not able to find the oracle libraries because the script was being triggered as the user mqm. Here's what I got from IBM.
When effective and real uids differ,
LD_LIBRARY_PATH is ignored. This is for security reasons (so that
you cannot trick a setuid program into using the wrong dynamic
library).
.
The workaround is to put libclntsh.so.9.0 in /usr/lib
(perhaps with the aid of a symlink).
This worked. |
|
Back to top |
|
 |
|