Help on multiple residency on linux_64
Posted in 2010
A user running two IDS 11.50 instances on 64-bit CentOS couldn't get a shell script to override the environment variables (INFORMIXDIR, INFORMIXSERVER, ONCONFIG, INFORMIXSQLHOSTS, LD_LIBRARY_PATH, PATH) set in the informix user's profile, so he could not switch to the second instance. Respondents explained the cause: running the script as ./script or 'sh script' starts a child shell, so exports are lost on exit. The fix is to source it in the current shell with a dot and a space, e.g. '. ./script'.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Networking & sqlhosts Configuration
Hello, friends.
I´m having some troubles here on linux_64 (CentOS),
running IDS 11.50.FC6W1, in order to automate startup and shutdown scripts,
for two instances installed on the same cpu.
I just can´t re-adjust the environment variables on a shell script, it´s
not overwriting the original ones (from the first instance).
Ex: INFORMIXDIR is different on the two instances (even I´ve read it
isn´t necessary to use it).
It is adjusted for the first instance, on the profile of informix user.
Then, I need to change the vars to start the second one. But when I run
my script on the shell, it doesn´t do the trick.
Here´s the code of it..... please if someone could help me would be great!!!
-----------------------------------------------
#!/bin/sh
unset PATH
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export PATH
unset INFORMIXDIR
INFORMIXDIR=/opt/informix2export INFORMIXDIR
unset INFORMIXSERVER
INFORMIXSERVER=teste_2export INFORMIXSERVER
unset ONCONFIG
ONCONFIG=onconfig.teste_2export ONCONFIG
unset INFORMIXSQLHOSTS
INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhostsexport INFORMIXSQLHOSTS
unset LD_LIBRARY_PATH
LD_LIBRARY_PATH=$INFORMIXDIR/lib/:$INFORMIXDIR/lib/esql/:$INFORMIXDIR/lib/tools/export LD_LIBRARY_PATH
PATH=$PATH:$INFORMIXDIR/binexport PATH
-----------------------------------------------
Best regards!!!!
--
Alexandre Marini
Tecnologia da Informação - DBA
SEFAZ-MS / SGI-UIMP / Sistemas IBM-Informix
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
<http://www.iiug.org>
Hi Alexandre,
How and where you running this script?
For me, this appear all be OK...
Did you running with the dot first?
$ . your_script.sh
César
--- Em sex, 19/3/10, Alexandre Marini <amarini@fazenda.ms.gov.br> escreveu:
De: Alexandre Marini <amarini@fazenda.ms.gov.br>
Assunto: Help on multiple residency on linux_64 [19360]
Para: ids@iiug.org
Data: Sexta-feira, 19 de Março de 2010, 12:23
Hello, friends.
I´m having some troubles here on linux_64 (CentOS),
running IDS 11.50.FC6W1, in order to automate startup and shutdown scripts,
for two instances installed on the same cpu.
I just can´t re-adjust the environment variables on a shell script, it´s
not overwriting the original ones (from the first instance).
Ex: INFORMIXDIR is different on the two instances (even I´ve read it
isn´t necessary to use it).
It is adjusted for the first instance, on the profile of informix user.
Then, I need to change the vars to start the second one. But when I run
my script on the shell, it doesn´t do the trick.
Here´s the code of it..... please if someone could help me would be great!!!
-----------------------------------------------
#!/bin/sh
unset PATH
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export PATH
unset INFORMIXDIR
INFORMIXDIR=/opt/informix2export INFORMIXDIR
unset INFORMIXSERVER
INFORMIXSERVER=teste_2export INFORMIXSERVER
unset ONCONFIG
ONCONFIG=onconfig.teste_2export ONCONFIG
unset INFORMIXSQLHOSTS
INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhostsexport INFORMIXSQLHOSTS
unset LD_LIBRARY_PATH
LD_LIBRARY_PATH=$INFORMIXDIR/lib/:$INFORMIXDIR/lib/esql/:$INFORMIXDIR/lib/tools/export LD_LIBRARY_PATH
PATH=$PATH:$INFORMIXDIR/binexport PATH
-----------------------------------------------
Best regards!!!!
--
Alexandre Marini
Tecnologia da Informação - DBA
SEFAZ-MS / SGI-UIMP / Sistemas IBM-Informix
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
<http://www.iiug.org>
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
________________________________________________________________________________
____
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
Hello Cesar! I´ve already tryed to run it with "./", or even sh [script], but it doesn´t overwrite the variables. I´m totally lost here..... Regards.
Like Cesar mentioned, you have to 'source' the script with your env variables to get them into your current environment. You have to have the ".", then a space and then the env script. It works at a login prompt or inside of a shell script. Bob ----- Original Message ----- From: "ALEXANDRE MARINI" <amarini@fazenda.ms.gov.br> To: ids@iiug.org Sent: Friday, March 19, 2010 2:17:16 PM GMT -05:00 US/Canada Eastern Subject: Re: Help on multiple residency on linux_64 [19362] Hello Cesar! Ive already tryed to run it with "./", or even sh [script], but it doesnt overwrite the variables. Im totally lost here..... Regards. *******************************************************************************
Cesar, continuing your question, I´m running the script on the informix $HOME dir, and it has all the 777 permissions. (Our informix shell is bash, also) if you´d also need to know, ok? Thanks a lot.
Change the slash to space ".<space>your_shell" or ".<space>./your_shell" --- Em sex, 19/3/10, ALEXANDRE MARINI <amarini@fazenda.ms.gov.br> escreveu: De: ALEXANDRE MARINI <amarini@fazenda.ms.gov.br> Assunto: Re: Help on multiple residency on linux_64 [19362] Para: ids@iiug.org Data: Sexta-feira, 19 de Março de 2010, 15:17 Hello Cesar! I´ve already tryed to run it with "./", or even sh [script], but it doesn´t overwrite the variables. I´m totally lost here..... Regards. ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum. ________________________________________________________________________________ ____ Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com