nginx守护脚本
#! /bin/bash
pidFile=/usr/local/nginx/logs/nginx.pid
nginxBin=/usr/local/nginx/sbin/nginx
confFile=/usr/local/nginx/conf/nginx.conf
if [ ! -f $pidFile ]; then
$nginxBin -c $confFile
fi
mysql守护脚本
#!/bin/bash
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ]
then
echo "At time: `date` :MySQL error stop .">> /usr/local/mysql/var/mysqlcheck
/etc/init.d/mysql start
#echo "At time: `date` :MySQL server is stop."
else
echo "MySQL server is running ."
fi
|
|