If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Start/Stop informix automatically.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-09, 05:21
georgipa georgipa is offline
Registered User
 
Join Date: Dec 2002
Location: Madrid - Spain
Posts: 277
Start/Stop informix automatically.

I Gurus,

I need a script for start or stop the engine informix when start or shutdown the computer. the operative system is linux.

Thank you for you help.
Reply With Quote
  #2 (permalink)  
Old 10-29-09, 14:41
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Jundiai / SP - Brasil
Posts: 311
__________________
________________________________________
César Inacio Martins
Jundiai / SP - Brasil
http://www.imartins.com.br/informix - em Português
http://www.imartins.com.br/informix - English (translated by Google).
________________________________________
Reply With Quote
  #3 (permalink)  
Old 11-12-09, 08:43
bigcalm bigcalm is offline
Registered User
 
Join Date: Jul 2009
Posts: 37
Well, I'm on AIX, but this should be applicable.

First, you'll need to write 2 scripts, start_informix and stop_informix

mine is pretty simple...

start_informix

<code>
#!/bin/ksh
#
# Script to start the Informix Database and ISA Server.
#
echo "\nStarting the Informix Database .. \c"

/usr/informix/bin/oninit

if [ "$?" -eq "0" ]
then
echo "OK"
else
echo "FAILED"
fi

echo "\nStarting the ISA HTTP Server .... \c"

/usr/informix/ISA/sbin/isactl start

if [ "$?" -eq "0" ]
then
echo "OK\n"
else
echo "FAILED\n"
fi
exit 0

</code>

stop_informix
<code>
#!/bin/ksh
#
# Script to shutdown the Informix Server.
#

echo "\nShutting down Informix Server..."

su - informix -c "/usr/informix/bin/onmode -ky"

if [ "$?" -eq "0" ]
then
echo "\nInformix Server shutdown - OK"
else
echo "\nInformix Server shutdown - FAILED"
fi
</code>

Both scripts assume that you have INFORMIXDIR set correctly. Put both scripts somewhere accessible by informix.

Then, modify /etc/inittab to have the line...

informix:2: once: su - informix -c "start_informix"

and modify /etc/rc.shutdown to have the line...

su - informix -c "stop_informix"

(/etc/rc.shutdown may be empty before you start, this is not (that) unusual).
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On