#!/usr/bin/ksh
cd `dirname $0`
. ./common.lib
print_log INFO "stopcgw_sa.sh is being invoken to stop sa."
echo "Begin to stop cgw sa." | tee -a ${log_file}
typeset pid_tmpfile="sa_pid_$(date "+%Y%m%d%H%M%S").tmp"
ps -ef |grep ${LOGNAME} | grep "cp.*${cgw_path}/data/store" | grep -v "grep" > ${pid_tmpfile}
cat ${pid_tmpfile} | while read LINE
do
pid=`echo $LINE | awk '{print $2}' | sed -n '1p'`
pid_list="${pid_list} ${pid}"
kill -USR2 ${pid}
echo "sa|null|${pid}|cp\.*${cgw_path}/data/store" >> $1
done
ps -ef | grep ${LOGNAME} | grep "${cgw_path}/bin/sa -t 10 -n" | grep -v "grep" > ${pid_tmpfile}
cat ${pid_tmpfile} | while read LINE
do
nodeid=`echo $LINE | sed -n "s#.*sa -t 10 -n \([0-9]*\)#\1#p"`
pid=`echo $LINE | awk -F' ' '{print $2}' | sed -n '1p'`
echo "stop sa(NODE ID: ${nodeid}, PID: ${pid})" | tee -a ${log_file}
kill -USR2 ${pid}
echo "sa|${nodeid}|${pid}|${cgw_path}/bin/sa -t 10 -n" >> $1
done
rm -f sa_pid_*.tmp
echo "End to stop cgw sa." | tee -a ${log_file}
print_log INFO "End to execute stopcgw_sa.sh."
return 0
cd `dirname $0`
. ./common.lib
print_log INFO "stopcgw_sa.sh is being invoken to stop sa."
echo "Begin to stop cgw sa." | tee -a ${log_file}
typeset pid_tmpfile="sa_pid_$(date "+%Y%m%d%H%M%S").tmp"
ps -ef |grep ${LOGNAME} | grep "cp.*${cgw_path}/data/store" | grep -v "grep" > ${pid_tmpfile}
cat ${pid_tmpfile} | while read LINE
do
pid=`echo $LINE | awk '{print $2}' | sed -n '1p'`
pid_list="${pid_list} ${pid}"
kill -USR2 ${pid}
echo "sa|null|${pid}|cp\.*${cgw_path}/data/store" >> $1
done
ps -ef | grep ${LOGNAME} | grep "${cgw_path}/bin/sa -t 10 -n" | grep -v "grep" > ${pid_tmpfile}
cat ${pid_tmpfile} | while read LINE
do
nodeid=`echo $LINE | sed -n "s#.*sa -t 10 -n \([0-9]*\)#\1#p"`
pid=`echo $LINE | awk -F' ' '{print $2}' | sed -n '1p'`
echo "stop sa(NODE ID: ${nodeid}, PID: ${pid})" | tee -a ${log_file}
kill -USR2 ${pid}
echo "sa|${nodeid}|${pid}|${cgw_path}/bin/sa -t 10 -n" >> $1
done
rm -f sa_pid_*.tmp
echo "End to stop cgw sa." | tee -a ${log_file}
print_log INFO "End to execute stopcgw_sa.sh."
return 0