Calling SYSTEM from Stored Procedure...
Posted in 2000
Topics: Stored Procedures & SPL, Platform-Specific Issues
Solaris 2.6 Dynamic Server 7.31 I have a shellscript bleah.sh as follows #!/bin/sh . /bleah/setup_ld_library_path_variables /bleah/runbinary When I run this at the command line it runs fine - the script gets run which sets up the LD_LIBRARY_PATH needed for the binarys run time libraries. I want to run bleah.sh from a stored procedure. I make my SYSTEM call as normal - it finds and runs bleah.sh ok but the binary fails to run because it cannot find the run time libraries (ie. LD_LIBRARY_PATH must not be set?) 1) Why is this ? Why is different to running from the command line 2) How do you get around the problem... A.
In article <8427475C51D5D211A0DC00062B000D8F309607@tampa.credo.ie>, "Stephens, Alan" <alans@credo.ie> wrote: > Solaris 2.6 > Dynamic Server 7.31 > > I have a shellscript bleah.sh as follows > > #!/bin/sh > . /bleah/setup_ld_library_path_variables > /bleah/runbinary > > When I run this at the command line it runs fine - > the script gets run which sets up the LD_LIBRARY_PATH > needed for the binarys run time libraries. > > I want to run bleah.sh from a stored procedure. > I make my SYSTEM call as normal - it finds and runs > bleah.sh ok but the binary fails to run because it cannot > find the run time libraries (ie. LD_LIBRARY_PATH must not > be set?) > > 1) Why is this ? Why is different to running from the command line > 2) How do you get around the problem... A. Not having seen your code, it's hard to domore than guess. It appears that soem env variable did not get exported for the benefit of the binary. This can't be LD_LIBRARY_PATH because, after all, it does work when you execute the script manually - assuming it was mot already set in your .profile. As a curiosity, could you execute this script as a cron job? (Not an AT job - that automatically repicates your env; cron requires you to set up your entire env.) This may help uncover what env var is missing or unexported. HTH -- +----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+ |------------------- Bulletin Board Announcement ----------------------| | Congregants will please note that the bowl at the back of the church | | bearing the sign "For the Sick" is for monetary contributions only. | +----------------------------------------------------------------------+ Sent via Deja.com http://www.deja.com/ Before you buy.
Does the library path script of the runbinary depend on your runtime environment? Remember that the engine will be running the script using ITS environment not yours. Either walk through the script and binary source and determine the environment dependencies and add them to the bleah.sh or submit it as an 'at' and retrieve the script that at creates which contains your runtime environment and use that instead of bleah.sh. Art S. Kagel "Stephens, Alan" wrote: > > Solaris 2.6 > Dynamic Server 7.31 > > I have a shellscript bleah.sh as follows > > #!/bin/sh > . /bleah/setup_ld_library_path_variables > /bleah/runbinary > > When I run this at the command line it runs fine - > the script gets run which sets up the LD_LIBRARY_PATH > needed for the binarys run time libraries. > > I want to run bleah.sh from a stored procedure. > I make my SYSTEM call as normal - it finds and runs > bleah.sh ok but the binary fails to run because it cannot > find the run time libraries (ie. LD_LIBRARY_PATH must not > be set?) > > 1) Why is this ? Why is different to running from the command line > 2) How do you get around the problem... > > A.