Managing Systems and Workgroups: A Guide for HP-UX System Administrators

Administering a System: Booting and Shutdown
Customizing Start-up and Shutdown
Chapter 5 517
killproc()
{
pid=`ps -e | awk '$NF~/'"$1"'/ {print $1}'`
if [ "X$pid" != "X" ]
then
if kill "$pid"
then
echo "$1 stopped"
else
rval=1
echo "Unable to stop $1"
fi
fi
}
case $1 in
'start_msg')
# message that appears in the startup checklist
echo "Starting the web_productname daemon"
;;
'stop_msg')
# message that appears in the shutdown checklist
echo "Stopping the web_productname daemon"
;;
'start')
# source the configuration file
if [ -f /etc/rc.config.d/web_productname]
then
. /etc/rc.config.d/web_productname
else
echo "ERROR: /etc/rc.config.d/web_productname
MISSING"
fi
# Check to see if the web_productname daemon exists,
# is executable and should be started
if [ "$WEB_PRODUCTNAME" -eq 1 -a -x
"$WEB_PRODUCTNAMEHOME/$web_productname_daemon" ]
then
cd $WEB_PRODUCTNAMEHOME
./$web_productname_daemon
print "$web_productname_daemon started"
else