Re: Unix Environment when executing a SYSTEM command
Posted in 1998
Topics: Internationalization & Character Sets
Leffler, Jonathan wrote:
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.
>
Hmmm,That implies that the oninit is run as informix.
So you can try the following.
Create a stored proceedure which takes an environment variable and writes it to a file.
You can then go to the Informix's .profile or .cshrc depending on the startup shell,
set the test variable. Test your sp.
Take down the instance of Online, restart it, and check the sp again.
If it works both times, then we know that when the sp is executed, it gets a fresh
copy of the environment variables.
If it works only after restarting the engine, then we know it gets its environment
at start-up.
Now, if that's the case, you can do the following.
From inittab, have a process start Informix, via a shellscript.
Then set the environment variables in that shell script.
-HTH
Mikey
> 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>