Consultor Eletrônico



Kbase 15069: sample 6.2 shutdown script for workaround to proshut hang
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
sample 6.2 shutdown script for workaround to proshut hang

For PROGRESS Release 6.2L and early releases of Version 6.3,
use the following script to workaround issues created when
PROSHUT with the KILL Users (-by) option does not work properly.
This script shuts down the database as nicely as possible. It
is a general script and you might need to modify it for your
operating system. The following standard disclaimer s apply
to the script.

* This script might not work on all UNIX systems.
* Although Progress Software provides this script to customers,
it does not support it.


#!/bin/ksh
#
# New Shutdown Script
# Adam Backman - Progress Software Corp.
#
DB_NAME=$1
DLC=${DLC-/usr/dlc}
RESP=${RESP-/etc/cluster/dbresp}
PATH=.:$DLC:DLC/probin:$PATH

# Getting list of users

proshut $DB_NAME < $RESP > /tmp/$DB_NAME.userout

# Check for users

exec 9< /tmp/$DB_NAME.userout
read usr extrajunk <&9
if test $usr != "usr"
then
echo "No users or server at this time for " $DB_NAME
proshut -bn $DB_NAME &
fi
# Read and convert (if needed) pid to kill

read _num pid day month date time year userid tty limbo <&9

echo "killing " $pic
while test .$pid
do
if test $pid -le 0
then
pid='echo 65536 + $pid | bc'
fi

# Make sure this is a PROGRESS process before killing it

ps -ef | grep $pid | grep _progres 2>/dev
ull 1>/dev
ull

if test $? = 0
then
kill -15 $pid 2> /dev
ull

# Start shutting down the database

echo "shutting down: " $DB_NAME

proshut -by $DB_NAME >> $DB_NAME.lg &

# Wait for shutdown to finish> # Test to see if DB is still up
proutil $DB_NAME -C busy

if test $? = 0
then exit 0
fi
# IF it makes it here then kill the user sessions

kill -9 $pid 2> /dev
ull
fi
read _num pid day month date time year userid tty limbo <&9
done

# Start shutting down the database

echo "shutting down: " $DB_NAME

proshut -by $DB_NAME >> $DB_NAME.lg &

# Wait for shutdown to finish

sleep 360

# Test to see if DB is still up

proutil $DB_NAME -C busy
if test $? = 0
then exit 0
fi

# Second try at shutdown with forced access

proshut -by $DB_NAME -F >> $DB_NAME.lg &

# Wait for forced shutdown to finish

sleep 5

# Test to see if DB is still up

proutil $DB_NAME -C busy

if test $? = 0
then exit 0
fi

# Kill off the Broker process

ps -ef | grep $DB_NAME | grep _mprosrv > /tmp/$DB_NAME.bproc.out

exec 9< /tmp/$DB_NAME.bproc.out

read userid pid jnk <&9

while test .$userid != .""
do
echo "Killing the broker process" >> $DB_NAME.lg
kill -15 $pid 2>/dev
ull
kill -9 $pid 2>/dev
ull
read userid pid jnk <&9
done
# end of script


Progress Software Technical Support Note # 15069