Ubuntu php5-fpm throws unknown instance on reload

前端 未结 9 880
忘了有多久
忘了有多久 2020-12-24 06:28

I am having some problems with ubuntu and php5-fpm on my VPS. Php works fine, however it throws terminal error when I am trying to reload / restart / stop it. Basically, I c

9条回答
  •  渐次进展
    2020-12-24 06:56

    Seems like the service command sometimes fails. I don't know about the reason, however I ended up using this workaround in /etc/logrotate.d/php5-fpm:

    /var/log/php5-fpm.log {
        ...
        postrotate
            # The original reload command did never work
            #invoke-rc.d php5-fpm reopen-logs > /dev/null
    
            # Workaround for cases when the reload command fails for some reason
            service php5-fpm reload > /dev/null 2>&1
            [ $? = 0 ] || ( service php5-fpm stop; pkill php5-fpm; service php5-fpm start ) > /dev/null
        endscript
    }
    

提交回复
热议问题