2022-08-06|閱讀時間 ‧ 約 1 分鐘

Centos監控php-fpm服務如果出現502 直接重啟

    vi /root/php-fpm.sh
    #!/bin/bash
    php_url="http://localhost/hscheck.php"
    RESULT='curl -I $php_url | grep "HTTP/1.1 502"'
    if [ -n "$RESULT" ]; then
    killall -9 php-fpm
    service php-fpm restart
    fi chmod 755 /rorot/php-fpm.sh 加入排程 */1 * * * * /root/php-fpm.sh 參考 https://blog.csdn.net/weixin_42410566/article/details/115757768
    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.