Sample Configurations with SGeRAC and Oracle RAC 10gR2, March 2009
50
# Monitor cssd daemons
#########################################################################
####
function monitor_processes
{
typeset -i n=0
# Grab the PID of the CSS daemon
for i in ${CSSD_MONITOR_PROCESSES[@]}
do
CSSD_MONITOR_PROCESSES_PID[$n]=`ps -fu $ORACLE_USER | awk
'/'${i}$'/ { print $2 }'`
print "Monitored process = ${i}, pid =
${CSSD_MONITOR_PROCESSES_PID[$n]}
"
if [[ ${CSSD_MONITOR_PROCESSES_PID[$n]} = "" ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} is not running ***"
return 0
fi
(( n = n + 1 ))
done
# wait until CSS process goes away
while true
do
for i in ${CSSD_MONITOR_PROCESSES_PID[@]}
do
kill -s 0 ${i} > /dev/null
if [[ $? != 0 ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has stopped. ***"
return 0
fi
done
sleep ${MONITOR_INTERVAL}
done
}
#########################################################################
####
# Function: css_enable_cmds
#
# Enable CSS to auto start
#########################################################################
####
function css_enable_cmds
{
$ORA_CRS_HOME/bin/crsctl enable crs
}
#########################################################################
####
# Function: css_disable_cmds
#
# Disable CSS from auto start