宝塔常见进程守护方法

网络 1 分钟阅读
添加MySQL进程守护脚本方法
pgrep -x mysqld &> /dev/null
if [ $? -ne 0 ];then
bash /www/server/panel/script/rememory.sh
/etc/init.d/mysqld start
fi
 
添加redis进程守护脚本方法
pgrep -x redis &> /dev/null
if [ $? -ne 0 ];then
/etc/init.d/redis start
fi
 
添加nginx进程守护脚本方法
pgrep -x nginx &> /dev/null
if [ $? -ne 0 ];then
/etc/init.d/nginx start
fi
 
添加php-fpm进程守护脚本方法
pgrep -x php-fpm &> /dev/null
if [ $? -ne 0 ];then
/etc/init.d/php-fpm-{52|53|54|55|56|70|71|73} restart
fi
 
添加memcached进程守护脚本方法
pgrep -x memcached &> /dev/null
if [ $? -ne 0 ];then
/etc/init.d/memcached restart
fi

评论

评论加载中…

Copyright © 2011-2026 blog.cctv.com.im All Rights Reserved. 醉卧烟雨 版权所有

Powered by Hugo . Theme by bigfa