RE: Calling SYSTEM from Stored Procedure...
Posted in 2000
Topics: Stored Procedures & SPL, Platform-Specific Issues
I did this and as expected the variables that should be getting set by /bleah/setup_ld_library_path_variables are NOT. I even tried forcing a new shell by changing the call in the SProcedure from system "..../bleah.sh" to system "sh ..../bleah.sh" No difference though. Ive checked it again and it works fine from the command line. I explicity changed LD_LIBRARY_PATH= blank before running it. It gets set by the the /bleah/setup_ld_library_path_variables and there are no problems. It certainly looks like an issue with the way shellscripts get run from a system command in a SProc. > -----Original Message----- > From: Watson Paul [mailto:Paul.Watson@fefc.ac.uk] > Sent: 04 August 2000 12:58 > To: 'Stephens, Alan'; informix-list@iiug.org > Subject: RE: Calling SYSTEM from Stored Procedure... > > > in your scrip add > > env > /tmp/eric > > and then x-check this against the working enviroment > > Paul Watson # > WF Software Ltd # If in doubt > Tel: +44 1436 674729 # make it up > Fax: +44 1436 678693 # > www.wfsoftware.com # > > > > -----Original Message----- > > From: Stephens, Alan [mailto:alans@credo.ie] > > Sent: Friday, August 04, 2000 9:41 AM > > To: informix-list@iiug.org > > Subject: Calling SYSTEM from Stored Procedure... > > > > > > 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. > > > > > > > > > The contents of this e-mail are confidential to the ordinary > user(s) of the > mail address(es) to which it was sent and may be legally privileged. > If you are not the intended recipient, any disclosure, > copying, distribution > or use of it, or any part of it, in any form whatsoever, and > any actions > taken or omitted to be taken in reliance on it, is prohibited > and may be > unlawful. > >
A thought! Post the contents of /bleah/setup_ld_library_path_variables. You are running the script using /bin/sh using the '#!' feature, Borne Shell requires you to re-export any variables that you change which Korn Shell and Bash do not. Are you re-exporting the variables in that script? It may work in your login session just because you already have them set correctly in your private environment. Art S. Kagel "Stephens, Alan" wrote: > > I did this and as expected the variables that should be > getting set by /bleah/setup_ld_library_path_variables > are NOT. > > I even tried forcing a new shell by changing > the call in the SProcedure from > system "..../bleah.sh" > to > system "sh ..../bleah.sh" > > No difference though. > > Ive checked it again and it works fine from the > command line. I explicity changed LD_LIBRARY_PATH= > blank before running it. It gets set by the > the /bleah/setup_ld_library_path_variables and there > are no problems. > > It certainly looks like an issue with the way > shellscripts get run from a system command in a SProc. > > > -----Original Message----- > > From: Watson Paul [mailto:Paul.Watson@fefc.ac.uk] > > Sent: 04 August 2000 12:58 > > To: 'Stephens, Alan'; informix-list@iiug.org > > Subject: RE: Calling SYSTEM from Stored Procedure... > > > > > > in your scrip add > > > > env > /tmp/eric > > > > and then x-check this against the working enviroment > > > > Paul Watson # > > WF Software Ltd # If in doubt > > Tel: +44 1436 674729 # make it up > > Fax: +44 1436 678693 # > > www.wfsoftware.com # > > > > > > > -----Original Message----- > > > From: Stephens, Alan [mailto:alans@credo.ie] > > > Sent: Friday, August 04, 2000 9:41 AM > > > To: informix-list@iiug.org > > > Subject: Calling SYSTEM from Stored Procedure... > > > > > > > > > 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. > > > > > > > > > > > > > > > The contents of this e-mail are confidential to the ordinary > > user(s) of the > > mail address(es) to which it was sent and may be legally privileged. > > If you are not the intended recipient, any disclosure, > > copying, distribution > > or use of it, or any part of it, in any form whatsoever, and > > any actions > > taken or omitted to be taken in reliance on it, is prohibited > > and may be > > unlawful. > > > >