Highly Available HP-UX Internet Services (May 2008)

sleep 10 ; # Wait for the named daemon to get running
if [ -r /var/run/named.pid ]
then
PID=`cat /var/run/named.pid`
else
PID=$(ps -e |
while read _PID _TTY _TIME _CMD
do
[[ "$_CMD" = "named" ]] && echo $_PID
done)
fi
if [ "$PID" = "" ]
then
echo No name server is running. >&2
exit 1
fi
while [ 1 ]
do
ps -el | grep $PID > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo Name Server failed.
exit 1
fi
sleep 2
done
HP ServiceGuard Start and Stop Script for DNS
This section discusses the start and stop scripts for DNS in an HP ServiceGuard
environment.
This section addresses the following topics:
“Sample Start Script for DNS” (page 20)
“Sample Stop Script for DNS” (page 21)
Sample Start Script for DNS
Following is a sample start script for DNS in an HP ServiceGuard environment.
function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
print "$(date '+%b %e %X') - Node \"$(hostname)\": Starting the named daemon\n"
if [ -f /etc/rc.config ] ; then
. /etc/rc.config
20