# This host currently masters the logical host that HA-in.named uses, $MYLH
# See if in.named is already running, if so exit. (We must have
# started it on some earlier cluster reconfiguration when this
# physical host first took over mastery of the $MYLH logical host.)
# We determine whether in.named is already running by using the pmfadm
# command to query its status: if the query succeeds, it is already
# running.
if pmfadm -q hainnamed >/dev/null 2>&1 ; then
exit 0
fi
HA_INNAMED_DIR="`cat $CONFIG`"
if [ ! -d $HA_INNAMED_DIR ]; then
logger -p ${SYSLOG_FACILITY}.err \
"${ARGV0}: directory $HA_INNAMED_DIR missing or not mounted"
exit 1
fi
# We cd to the HA_INNAMED_DIR directory because the named.boot file
# contains the names of other files. By cd'ing, we permit all of
# those names to be relative names, relative to the current directory
cd $HA_INNAMED_DIR
if [ ! -s named.boot ]; then
logger -p ${SYSLOG_FACILITY}.err \
"${ARGV0}:file $HA_INNAMED_DIR/named.boot is missing or empty"
exit 1
fi
# Run the in.named daemon under the control of the Sun Cluster process
# monitory facility. Let it crash and restart up to 4 times an hour;
# if it crashes more often than that, the process monitor facility daemon
# will cease trying to restart it.
pmfadm -c hainnamed -n 4 -t 60 /usr/sbin/in.named -b named.boot
if [ $? -ne 0 ]; then
logger -p ${SYSLOG_FACILITY}.err \
"${ARGV0}: pmfadm -c of in.named failed"
exit 1
fi
exit 0
|