
스크립트가 있습니다 (여기에서 발견), 로그 파일을 모니터링하기 위한 것입니다. 키워드가 트리거되면 명령을 실행합니다.
journalctl -f | \
while read line ; do
echo "$line" | grep "apcu"
if [ $? = 0 ]
then
systemctl restart php7.2-fpm.service
fi
done
다음 줄을 사용하여 systemd 서비스를 만들고 활성화했습니다.
[Service]
ExecStart=/home/alex/journal-trigger.sh
StandardOutput=file:/home/alex/journal-trigger.log
StandardError=file:/home/alex/journal-trigger.error.log
이는 apcu.so 모듈이 실패할 경우 PHP 서비스를 다시 시작하는 임시 조치입니다. 그러나 한 가지 단점이 있습니다(명령이 'apcu'로 구성되는 경우).
sudo php cachetool.phar apcu:cache:info --fcgi
In FastCGI.php line 133:
FastCGI error: Stream got blocked, or terminated. (/var/run/php/php7.2-fpm.sock)
In Socket.php line 525:
Stream got blocked, or terminated.
어떻게 해결할 수 있나요?
답변1
좋아, 나는 이 문제를 다음과 같이 해결했습니다. grep kernel\:\ traps\:.*apcu\.so
그러나 실제 수정은 애플리케이션 수준에서 이루어졌습니다. apcu_clear_cache()
prod 서버의 PHP 코드에 의도치 않게 남겨졌습니다...