システムは自動的にタイムアウト処理プロセスを強制終了

対象os:
linux

processkill.sh

#!/bin/sh

ps_result=`ps -aux|grep httpd|grep -v Ss|grep -v S+|awk '{printf(“%d-%d “,$2,$10)}’|awk -F: '{print $1}’`
KILLED_FILE=’/usr/sh/logs/killed_proc.log’

for proc in $ps_result
do
pid=`echo “$proc"|awk -F- '{print $1}’`
time=`echo “$proc"|awk -F- '{print $2}’`
if [ $time -ge 1 ];then
kill -9 $pid
#echo $pid
echo `date +"%Y-%m-%d %H:%M:%S"`"|"$pid":"$time" are killed" >> $KILLED_FILE
echo “rep commant:ps -aux|grep httpd|grep -v Ss|grep -v S+|awk '{printf(“%d-%d “,$2,$10)}’|awk -F: '{print $1}'" >> $KILLED_FILE
fi
done

#echo $ps_result;

Source

Posted by arkgame