Sample Assure MIMIX for AIX shutdown script - assure_mimix - assure_mimix_for_aix - 6.0

Assure MIMIX for AIX Guide

Product type
Software
Portfolio
Integrate
Product family
Assure
Product
Assure MIMIX™ Software for AIX
Version
6.0
ft:locale
en-US
Product name
Assure MIMIX for AIX
ft:title
Assure MIMIX for AIX Guide
Copyright
2025
First publish date
2003
ft:lastEdition
2025-03-12
ft:lastPublication
2025-03-12T05:07:12.494000

This section shows a sample Assure MIMIX for AIX shutdown script. The shutdown script needs to be executed at the end of the application server shutdown sequence, after all applications have been stopped gracefully.

Sample Assure MIMIX for AIX Shutdown script

#!/bin/ksh
#****** <Insert your application stop script here> ******
 
#****** Modify the CONTEXT_ID (Primary ContextID) below ******
#****** to match your environment ******
CONTEXT_ID=1
 
# Read Environment and Common Functions
. /usr/scrt/bin/sccfgd_arch
DATE_CMD=$(date +"%Y-%m-%d %T")
 
 
RTSTOPLOG=/usr/scrt/log/rtstop_c${CONTEXT_ID}.log
echo "${DATE_CMD}: Shutting down ${PRODUCT_NAME} ..." > $RTSTOPLOG
 
/usr/scrt/bin/rtumnt -C${CONTEXT_ID}  >> $RTSTOPLOG 2>&1
if [[ $? -eq 0 ]]
then
        echo "${DATE_CMD}: rtumnt failed" >> $RTSTOPLOG 2>&1
        for i in `/usr/scrt/bin/sclist -C${CONTEXT_ID} -f`
               do
               fuser -k $i
               done
        /usr/scrt/bin/rtumnt -C${CONTEXT_ID} >> $RTSTOPLOG 2>&1
       if [[ $? -ne 0 ]]
       then
                echo "${DATE_CMD}: rtumnt failure" >> $RTSTOPLOG 2>&1
               exit 1
       fi
fi
 
/usr/scrt/bin/rtstop  -C ${CONTEXT_ID} -kFv >> $RTSTOPLOG 2>&1
if [[ $? -ne 0 ]]
then
    echo "${DATE_CMD}: ${PRODUCT_NAME} shutdown failed" >> $RTSTOPLOG 2>&1
   exit 1
fi
 
echo "${DATE_CMD}: ${PRODUCT_NAME} shutdown successful" >> $RTSTOPLOG 2>&1
exit 0