RE: Calling SYSTEM from Stored Procedure...
Posted in 2000
The problem is that the moment you invoke system from stored procedures,
it goes as a different user. I think the problem is not how you're executing
bleah.sh but what it actually does. Have all your environment variables set
inside this script like this
export INFORMIXDIR=/db/informix
export INFORMIXSERVER=on_ws_prd1
export PATH=$INFORMIXDIR/bin:/usr/bin:/bin...................
Let your PATH have all necessary directories etc...
Just to test if these variables are being set in the program. At the end of this
script you could
echo $INFORMIXDIR > /tmp/a.out
echo $INFORMIXSERVER >> /tmp/a.out
echo $PATH >> /tmp/a.out
It should work.
Vivek
______________________________ Reply Separator _________________________________
Subject: RE: Calling SYSTEM from Stored Procedure...
Author: alans (alans@credo.ie) at internet
Date: 8/4/00 8:11 AM
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.
>
>