Setting up an HP SIM server 6.0 or greater on a Linux-based Serviceguard Cluster White Paper 444847-004, February 2010

45
Wher
e:
o
hpsim.config is the configuration file for the package
.
o
hpsim.sh is the control script
.
o
hpsim.sh.log is the log file for the control script file
.
8.
Create the init script
.
The init script starts
the HP SIM application including the
d
atabase
daemon.and is
l
ocated on the shared drive.
#
vi
/hpsimlnx/etc/init.d/sgsim
#
!/bin/sh
# sgsim This is the init script for starting up the HPSIM + SG
#
# chkconfig:
-
99 01
# description: Starts and stops the HPSIM + Hpsmdb backend daemon
# processname: sgsim
# pidfile:
/hpsimlnx/var/opt/hpsmdb/data/sgsim.pid
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
# Get function listing for cross
-
distribution logic.
TYPESET=`typeset
-
f|grep "declare"`
NAME=sgsim
# Check that networking is up.
# Pretty much
need it for hpsmdb.
[ "${NETWORKING}" = "no" ] && exit 0
# rebuild the ld.so cache in order to include
# the dyn. Libs under /hpsimlnx
# Mandatory to be able to start pg_ctl
ldconfig 2>&1 > /dev/null
start(){
PSQL_START=$"Starting ${NAME} servi
ce: "
/etc/init.d/hpsmdb start
stat=$?
Sleep 2
if [ $stat
-
eq 0 ]; then
/etc/init.d/hpsim start
if [ $?
-
eq 0 ]; then
success "$NAME"
touch /var
/lock/subsys/${NAME}
echo
else
failure "$NAME (hpsim)"
echo
exit
-
1
fi
else
failure "$NAME (hpsmdb)"
echo
exit
-
1
fi
}
stop(){
echo
-
n $"Stopping ${NAME} service: "
/etc/init.d/hpsim stop
ret=$?
Sleep 20