宝塔面板装了nginx php-fpm mysql如何监视这些进程并自动重启额

宝塔面板装了nginx php-fpm  mysql如何监视这些进程并自动重启额

看了nginx 的启动命令是 /www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf

mysql的启动命令是  /www/server/mysql/bin/mysqld –basedir=/www/server/mysql –datadir=/www/server/data –plugin-dir=/www/server/mysql/lib/plugin –user=mysql –sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION –log-error=localhost.err –open-files-limit=65535 –pid-file=/www/server/data/localhost.pid –socket=/tmp/mysql.sock –port=3306

php-fpm只查到
master process (/www/server/php/56/etc/php-fpm.conf)

感谢楼下的解答
后来查看了下他们的释放内存代码  拿他们的代码改下就行

#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#+————————————
#+ 宝塔释放内存脚本
#+————————————

endDate=`date +”%Y-%m-%d %H:%M:%S”`
log=”释放内存!”
echo “★[$endDate] $log”
echo ‘—————————————————————————-‘

if [ -f “/etc/init.d/php-fpm-52” ];then
        /etc/init.d/php-fpm-52 reload
fi

if [ -f “/etc/init.d/php-fpm-53” ];then
        /etc/init.d/php-fpm-53 reload
fi

if [ -f “/etc/init.d/php-fpm-54” ];then
        /etc/init.d/php-fpm-54 reload
fi

if [ -f “/etc/init.d/php-fpm-55” ];then
        /etc/init.d/php-fpm-55 reload
fi

if [ -f “/etc/init.d/php-fpm-56” ];then
        /etc/init.d/php-fpm-56 reload
fi

if [ -f “/etc/init.d/php-fpm-70” ];then
        /etc/init.d/php-fpm-70 reload
fi

if [ -f “/etc/init.d/php-fpm-71” ];then
        /etc/init.d/php-fpm-71 reload
fi

if [ -f “/etc/init.d/php-fpm-72” ];then
        /etc/init.d/php-fpm-72 reload
fi

if [ -f “/etc/init.d/php-fpm-73” ];then
        /etc/init.d/php-fpm-73 reload
fi

if [ -f “/etc/init.d/php-fpm-74” ];then
        /etc/init.d/php-fpm-74 reload
fi

if [ -f “/etc/init.d/mysqld” ];then
        /etc/init.d/mysqld reload
fi

if [ -f “/etc/init.d/nginx” ];then
        /etc/init.d/nginx reload
fi

if [ -f “/etc/init.d/httpd” ];then
        /etc/init.d/httpd graceful
fi

if [ -f “/etc/init.d/pure-ftpd” ];then
        pkill -9 pure-ftpd
        sleep 0.3
        /etc/init.d/pure-ftpd start 2>/dev/null
fi

sync
sleep 2
sync
echo 3 > /proc/sys/vm/drop_caches

echo ‘—————————————————————————-‘

辽宁省网友说:计划任务里设置 释放内存脚本就会重启这三个

云南省网友说:shell写脚本判断进程是否存活,不活就自动执行重启

甘肃省网友说:直接用supervisor

江西省网友说:supervisor 直接进程守护,

© 版权声明
THE END
喜欢就支持以下吧
点赞0
分享
评论 抢沙发