Highly Available HP-UX Internet Services (May 2008)
set_return
;;
*)
echo "usage: $0 {start|stop}"
rval=1
;;
esac
exit $rval
Appendix C: Sample Scripts for FTP
This section lists sample monitor and startup/stop scripts for FTP in an HP ServiceGuard
environment.
This section discusses the following topics:
• “HP ServiceGuard Monitor Script for FTP” (page 28)
• “HP ServiceGuard Startup/Stop Script for FTP” (page 28)
HP ServiceGuard Monitor Script for FTP
Following is a sample monitor script for FTP in an HP ServiceGuard environment:
while true
do
string=`ps -e | grep ftpd` > /dev/null
if [ $? -eq 1 ]; then
exit 1
else
pid=`echo ${string} | awk '{print $1}'`
if [[ $pid = "" ]]; then
return 1
fi
fi
done
HP ServiceGuard Startup/Stop Script for FTP
Following is a sample startup/stop script for FTP in an HP ServiceGuard environment:
case "$1" in
'start')
echo "Start Package service"
/usr/lbin/ftpd -S -a
;;
'stop')
echo "Stopping Internet services daemon"
pid=`ps -e | grep ftpd | awk '{print $1}'`
if [[ $pid != "" ]]; then
kill -9 ${pid}
return $?
28