RE: Unix Environment when executing a SYSTEM command
Posted in 1998
----------
From: Fontaine, Maurice[SMTP:Maurice.Fontaine@fmr.com]
Sent: Tuesday, February 10, 1998 4:09 PM
To: 'informix-list@iiug.org'
Subject: Unix Environment when executing a SYSTEM command
My environment is Informix 7.1 running on Solaris 2.5.1
The client program is a VB front-end that calls a stored procedure that
in turn executes an ESQL/C program via the SYSTEM command.
The problem is I did not code the path to the executable in the stored
procedure and the stored procedure gives an error.
If I code the path to the executable, everything runs fine.
So aside from hard-coding the path to the executable in the stored
procedure or storing it in some database table, both of which involve
possible changes when moving to different machines what can be done?
What environment does user get when executing the SYSTEM command given
the fact that they are executing from a front-end which doesn't have a
Unix Environment?
JL: The environment is not specifically documented anywhere that I know of, but is probably
the environment available to the oninit program at the time it was started, give or take very little.
There may be some Informix-specific environment variables (such as locales), but things like
PATH and LD_LIBRARY_PATH will be the values when oninit is started. That typically means
that the environment is minimal if the OnLine system is started when the machine is booted.
Is there a file I can create on the server that all the users would have
'sourced' as their environment?
They do not have Unix home directories, just an account for database
access.
JL: You have a couple of choices. One is to ensure that the relevant environment is available
when the OnLine system is booted. The other is to run commands from the SP with a pathname
which is fixed across all systems (use symlinks to fix the location on other machines), and the
script can set the environment etc using all the technology available to scripts in general.
Yours,
Jonathan Leffler (jleffler@visa.com) #include <bother.ms-exchange.h>