Server starting

> I want to start a second iidbms process with a specific object name
> inserted into the name server. Is there any way to do this automatically,
> or do I have to either use iinamu by hand to add server started with
> -nonames (Providing my own OBJ_NAME), or write something to parse the
> II_DBMS_NAME from runrundbms, and setup iinamu from that (ie has anyone
> already invented this particular wheel?)
> 
> TIA...
> 
> 
> --
> ======================================================================
> |  Hamish Marson                                                     |
> |  Systems Programmer & News Manager          news@news.waikato.ac.nz|
> |  Computer Services               | INTERNET h.marson@waikato.ac.nz |
> |  University of Waikato           | PHONE    +64 7 8562889 xt 8181  |
> |  New Zealand                     | FAX      +64 7 8384066          |
> ===========Disclaimer :- Remember. You heard it here first.===========
> If nuclear bombs are so safe why don't the French test them under Paris
> 
Here is a script I use to start a new server with a given class name.
I do not claim that this is THE best way but it works on my Pyramid box.


#!/bin/ksh
#
#       This script starts a new INGRES Server
#       and assigns it to the class passed as argument
#
# Author:       Charles R. Lancaster
# Date Written: April 7, 1993
#
# Verify the server class name
#
grep $1 $II_SYSTEM/ingres/files/name/iiname.all > /dev/null
if [ $? -ne 0 ] 
then
echo " "
echo "******************************************"
echo " "
echo $1 is not a valid server class name
echo Please try again with a correct class name
echo " "
echo "******************************************"
echo " "
exit 1
fi
#
# First start a new server with server options file
#
runrundbms $II_SYSTEM/ingres/files/rpt_server.opt
PDATE=`date +%H:`
sleep 10
#
# Now get the INGRES Server Number just started and the process id of the server
#
LASTSVR=`iinamu < $II_SYSTEM/ingres/files/iinamu.show|tail -1|awk '{print $3}'`
LASTPID=`ps -fu ingres|grep dbms|grep $PDATE|grep -v grep|sort +4|tail -1|awk 'NR == 1 {print $2}'`
#
# Next delete INGRES server from name list
# And add server of class passed as argument
#
echo "delete ingres *" $LASTSVR > /tmp/addsvr
echo "add $1 *" $LASTSVR >> /tmp/addsvr
echo show $1 >> /tmp/addsvr
echo quit >> /tmp/addsvr
iinamu < /tmp/addsvr 
#
# Log a record into errlog.log file
#
echo `date` REPORT SERVER $1 $LASTSVR is pid $LASTPID >> $II_SYSTEM/ingres/files/errlog.log
echo `date` REPORT SERVER $1 $LASTSVR is pid $LASTPID 
#
# Remove temp file
#
rm /tmp/addsvr

--
Charlie Lancaster - Information Resources
Texas Natural Resource Conservation Commission
Mail Code MC 197
P O Box 13087 Austin, TX 78711-3087
Phone:512-239-0795 FAX:512-239-0888 
e-mail:clancast@irgate.tnrcc.state.tx.us

Whatever the mind of man can conceive and believe it can achieve!
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William