> As the poet said, when spl executes a system program, the
> executed program has no environment by default.
Not quite true - it has the environment of IDS (the oninit process),
with some values taken from the client (but not all of them).
> Try running a script
> that sets your environment and executes your program instead. Maybe
[quoted text clipped - 16 lines]
>
> You will have to modify this to match your $INFORMIXDIR, etc.
Despite my initial comment, this is sound advice.
For whatever it is worth, I run IDS with an extremely tightly controlled
environment. By the time programs are run I get the following output:
Black JL: sqlcmd -d stores
SQL[1729]: create procedure sys(i integer default 0);
> system "environ >/tmp/environ.out";
> end procedure;
SQL[1730]: execute procedure sys(1);
SQL[1731]: bye;
Black JL: cd /tmp
Black JL: more environ.out
Date: Fri Jun 29 23:37:08 PDT 2007
Machine: black (SunOS 5.10)
User: uid=9508(jleffler) gid=1240(RD)
groups=54324(dbaao),54325(dbsso),54326(dbsa),8714(ccusers),1260(SA)
Directory: /work1/jleffler
Umask: 07
Terminal: not a tty
Limits (soft:hard):
coredump(blocks) unlimited:unlimited
data(kbytes) unlimited:unlimited
file(blocks) unlimited:unlimited
nofiles(descriptors) 256:256
stack(kbytes) 8192:unlimited
time(seconds) unlimited:unlimited
vmemory(kbytes) unlimited:unlimited
Environment:
CLIENT_LOCALE=en_US.8859-1
DBDATE=Y4MD-
DBMONEY=$.
DBPATH=//black_11
DBTEMP=/tmp
INFORMIXDIR=/usr/informix/10.00.UC5
INFORMIXSERVER=black_11
LC_COLLATE=en_US.819
LC_CTYPE=en_US.819
LC_MONETARY=en_US.819
LC_NUMERIC=en_US.819
LC_TIME=en_US.819
ONCONFIG=onconfig.black_11
PATH=.:/work1/jleffler/bin:/u/jleffler/bin:/usr/informix/10.00.UC5/bin:/u/jleffler/solaris/bin:/usr/
openssl/v0.9.7/bin:/usr/informix/9.40.UC7/bin:/usr/gnu/bin:/usr/atria/bin:/usr/perl/v5.8.8/bin:/usr/
bin:/usr/python/v2.5/bin:/usr/gdb/v6.2.1/bin:/usr/gnupg/v1.2.6/bin:/usr/gcc/v4.2.0/bin:/usr/tcl/v8.4
.11/bin:/workshop/Studio11/SUNWspro/bin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/us
r/sbin:/sbin
PWD=/work1/jleffler
SERVER_LOCALE=en_US.819
SHELL=/usr/bin/ksh
SQLPID=192311320
TZ=US/Pacific
_=/usr/gnu/bin/env
Black JL: asroot -- onstat -g env
IBM Informix Dynamic Server Version 10.00.UC5 -- On-Line -- Up 28
days 04:17:06 -- 31744 Kbytes
Server start-up environment:
Variable Value [values-list]
DBDELIMITER |
DBPATH .
DBPRINT lp -s
DBTEMP /tmp
IFX_LISTEN_TIMEOUT 3
INFORMIXCONCSMCFG /usr/informix/10.00.UC5/etc/concsm.black_11
INFORMIXDIR /usr/informix/10.00.UC5
[/usr/informix/10.00.UC5]
[/usr/informix]
INFORMIXSERVER black_11
INFORMIXTERM termcap
LC_COLLATE en_US.819
LC_CTYPE en_US.819
LC_MONETARY en_US.819
LC_NUMERIC en_US.819
LC_TIME en_US.819
LKNOTIFY yes
LOCKDOWN no
NODEFDAC no
ONCONFIG onconfig.black_11
PATH /usr/bin:/usr/informix/10.00.UC5/bin
SERVER_LOCALE en_US.819
SHELL /usr/bin/ksh
TERM dumb
TERMCAP /etc/termcap
TZ UTC0
Of the variables listed in the 'onstat -g env' output, I set:
IFX_LISTEN_TIMEOUT
INFORMIXDIR
INFORMIXSERVER
ONCONFIG
PATH
SHELL
TZ
(and HOME, which is the same as $INFORMIXDIR; the current directory of
the server is also $INFORMIXDIR, even though the system statement had
switched directory to /work1/jleffler, which is the value of $HOME - and
not the same as ~jleffler, the home directory in /etc/passwd). The
other variables are set by IDS.

Signature
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
slawek_k - 30 Jun 2007 12:58 GMT
> > As the poet said, when spl executes a system program, the
> > executed program has no environment by default.
[quoted text clipped - 131 lines]
> Email: jleff...@earthlink.net, jleff...@us.ibm.com
> Guardian of DBD::Informix v2007.0226 --http://dbi.perl.org/
Hello,
the problem is solved !
I made two errors.
The first: I have assumed that when the IDS started read the .profile
in its $HOME und set the LD_LIBRARY_PATH correctly.But it doesn't set
environment from
user informix. Followed environment from my IDS
SERVER_LOCALE=en_US.819
SQLPID=1912143896
DBPATH=.
SHELL=/bin/bash
INFORMIXDIR=/home/informix
CLIENT_LOCALE=de_de.8859-1
DBCENTURY=C
DBMONEY=,EUR
ONCONFIG=onconfig
DBDATE=dmy4.
TBCONFIG=onconfig
PATH=/home/informix:/home/informix/bin:/home/bank_tr/sh:.:/home/
bank_tr/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/
opt/gnome2/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/jre/bin:/opt/
gnome/bin
PWD=/home/bank_tr
DB_LOCALE=de_de.8859-1
SHLVL=1
INFORMIXSERVER=idsmars
DBTEMP=/tmp
INFORMIXSQLHOSTS=/home/informix/etc/sqlhosts
No LD_LIBRARY_PATH in environment ! So I follow your suggestion and
started my program from the script but at the same time I made
second error and set INFORMIXDIR to /opt/informix instead to /home/
informix
After I set the correct INFORMIXDIR the program is running !
Thank you for your help!
Slawek