IBM Data Server DB2 User Manual
Page 97

Chapter 2. DB2 server deployment
83
umountnfs()
{
set ${setopts?}
${RCMD} umount "$LOCALNFS"
rc=$?
# if unmount fails, try once more
if [ $rc != 0 ]; then
 echo "Unmount failed on machine $host. Will try again 2 seconds later."
 sleep 2
 echo "Trying unmount again..."
 ${RCMD} umount "$LOCALNFS"
 rc=$
 if [ $rc != 0 ]; then
 echo "Umount failed twice on machine $host. You need to do it manually."
 fi
fi
}
# check in memory if DB2 instance processes still exist.
chkdb2proc()
{
set ${setopts?}
# check if db2ilist exists
${RCMD} test -f $INSTPATH/instance/db2ilist
rc=$?
if [ $rc == 0 ]; then
 # get DB2 instances list
 for inst in `${RCMD} $INSTPATH/instance/db2ilist`
 do
 # check if db2_ps exists
 ${RCMD} su - "$inst -c \"which db2_ps\"" > /dev/null 2>&1
 rc=$?
 if [ $rc == 0 ]; then
 # count the number of db2 processes
 PSCOUNT=`${RCMD} su - $inst -c "db2_ps"|egrep -v '^Node | *UID| completed ok$'|\
 sed '/ */d'|wc -l`
 if [ $PSCOUNT -gt 0 ]; then
 printf "Process associated with DB2 instance %s found in memory.\n" $inst
 printf "Please clean all DB2 processes before deloying fix pack.\n"
 return 1
 else
 rc=0
 fi
 fi
 done
else
 return 1
fi
