RE: Informix Startup on HP-UX UNIX
Posted in 1997
Eric
Here is a script we use. The script is called informix and sits in =
/sbin/init.d. The script has 2 main arguments, start and stop. Both the =
arguments execute code that read off a data file containing information =
about database instances. The last is for (1) security purposes, the =
script is modifiable by root only while the data file can be modified by =
informix and (2) extensibility, you can add or drop instances and no =
changes need to be done to the script. Here it comes:
------------------------- cut here --------------------------------
#!/sbin/sh
#
# Informix Startup and Shutdown script. Called from Unix Startup and =
Shutdown
# scripts with arguments start or stop. Accesses a data file =
"instance.list"
# containing relevant parameters for each Informix instance. The data =
needs
# to be changed for each instance added or deleted from this machine. =
Works
# for both version 5 and 7 databases.
#
# Last Modified: 03/07/97 Sujit Pal
#
PATH=3D/sbin:/usr/sbin:/usr/binexport PATH
rval=3D0
set_return() {
x=3D$?
if [ $x -ne 0 ]; then
echo "ERROR CODE $x"
rval=3D1
fi
}
case $1 in
start_msg)
echo "Starting Informix Instances"
;;
stop_msg)
echo "Shutting down Informix Instances"
;;
'start')
TERMCAP=3D/usr/informix/etc/termcap; export TERMCAP
cat instance.list |
while read INST_LINE
do
if [ `echo $INST_LINE | cut -c1-1` =3D '#' ]
then
continue
fi
ver=3D`echo $INST_LINE | cut -f1 -d":" | cut -c1-1`
INFORMIXDIR=3D`echo $INST_LINE | cut -f2 -d":"`
ONCONFIG=3D`echo $INST_LINE | cut -f3 -d":"`
INFORMIXSERVER=3D`echo $INST_LINE | cut -f4 -d":"` INSTNAME=3D`echo $INST_LINE | cut -f5 -d":"`
echo "Starting " $INSTNAME "(" $ONCONFIG ")"
export INFORMIXDIR ONCONFIG INFORMIXSERVER
PATH=3D$INFORMIXDIR/bin:$PATH; export PATH if [ $ver -eq 7 ]
then
$INFORMIXDIR/bin/oninit
else
$INFORMIXDIR/bin/tbinit
fi
done
set_return
;;
'stop')
TERMCAP=3D/usr/informix/etc/termcap; export TERMCAP
cat instance.list |
while read INST_LINE
do
if [ `echo $INST_LINE | cut -c1-1` =3D '#' ]
then
continue
fi
ver=3D`echo $INST_LINE | cut -f1 -d":" | cut -c1-1`
INFORMIXDIR=3D`echo $INST_LINE | cut -f2 -d":"`
ONCONFIG=3D`echo $INST_LINE | cut -f3 -d":"`
INFORMIXSERVER=3D`echo $INST_LINE | cut -f4 -d":"` INSTNAME=3D`echo $INST_LINE | cut -f5 -d":"`
echo "Shutting down " $INSTNAME "(" $ONCONFIG ")"
export INFORMIXDIR ONCONFIG INFORMIXSERVER
PATH=3D$INFORMIXDIR/bin:$PATH; export PATH if [ $ver -eq 7 ]
then
$INFORMIXDIR/bin/onmode -ky
else
$INFORMIXDIR/bin/tbmode -ky
fi
done
set_return
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
exit $rval
------------------------- cut here ------------------------------
The format of the data file instance.list follows:
# Instance List for Database Instances
# VER:INFORMIXDIR:ONCONFIG:INFORMIXSERVER:INSTANCE_DESCRIPTION
7.12:/usr/informix:onconfig.xxx:xxx_shm:XXX Database Instance
HTH
Sujit Pal
----------
From: eric_r@iacorp.com[SMTP:eric_r@iacorp.com]
Sent: Monday, March 17, 1997 4:33 PM
To: informix-list@rmy.emory.edu
Subject: Informix Startup on HP-UX UNIX
Hi, I am trying to add Informix to the startup/shutdown procedures for
HP-UX 10.2. The DB is Informix DS for UNIX, Version 7.12.UC1. I already
know how to add scripts so that they get executed at startup and =
shutdown.
What I don't know is what shell script to execute, or the Informix
commands within the shell, to startup or shutdown Informix. Any help, =
or
sample scripts, would be appreciated. Thanks!!! :-) Eric Roseland
-------------------=3D=3D=3D=3D Posted via Deja News =
=3D=3D=3D=3D-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet