#!/bin/bash
flag=1
result=1
LOG=/opt/dcp/IM2000/log/syservice.log
if [ -f $LOG ]
then
rm $LOG
fi
while [ "$flag" -eq 1 ]
do
sleep 2
# date >> $LOG
#result=`pidof -x server.php` >> $LOG
#if [ -z "$result" ]
#then
#{
# /opt/dcp/IM2000/server/server.php & >> $LOG 2>&1
# echo "server.php restart" >> $LOG
#}
#fi
result=`pidof -x httpd` >> $LOG
if [ -z "$result" ]
then
{
date >> $LOG
service httpd start >> $LOG 2>&1
echo "httpd start" >> $LOG
w >> $LOG
}
fi
result=`pidof -x mysqld` >> $LOG
if [ -z "$result" ]
then
{
date >> $LOG
service mysqld start >> $LOG 2>&1
echo "mysqld start" >> $LOG
w >> $LOG
}
fi
result=`pgrep rsyslog` >> $LOG
if [ -z "$result" ]
then
{
date >> $LOG
service rsyslog start >> $LOG 2>&1
echo "rsyslog start" >> $LOG
w >> $LOG
}
fi
result=`pgrep crond` >> $LOG
if [ -z "$result" ]
then
{
date >> $LOG
service crond start >> $LOG 2>&1
echo "crond start" >> $LOG
w >> $LOG
}
fi
done
阅读(957) | 评论(0) | 转发(0) |