Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../proc/self/root/opt/maint/bin
File: opcache_check.sh
# This script is intended to be ran via CRON.
[0] Fix | Delete
[1] Fix | Delete
# It was written to catch opcache deadlocks where opcache cannot
[2] Fix | Delete
# kill a process owned by another user within the same FPM master.
[3] Fix | Delete
# Read more: https://github.com/php/php-src/issues/8072
[4] Fix | Delete
[5] Fix | Delete
# Count all locks with ZendSem in the name and only return ones that are over 20.
[6] Fix | Delete
lslocks | awk '/ZendSem/ {print $9}' | sort | uniq -c | awk '$1 > 20' | while read -r bad_lock; do
[7] Fix | Delete
bad_lock_count=$(echo "${bad_lock}" | awk '{print $1}');
[8] Fix | Delete
bad_lock_name=$(echo "${bad_lock}" | awk '{print $2}');
[9] Fix | Delete
[10] Fix | Delete
lslocks | grep "${bad_lock_name}" | grep READ | awk '/^php-fpm/ {print $2}' | while read -r bad_lock_pid; do
[11] Fix | Delete
# If the string isn't empty, proceed with the kill.
[12] Fix | Delete
if [[ -n "${bad_lock_pid}" ]]; then
[13] Fix | Delete
echo "opcache deadlock discovered: ${bad_lock_count} active locks for ${bad_lock_name} - sending kill: ${bad_lock_pid}" | systemd-cat -p info;
[14] Fix | Delete
kill -9 "${bad_lock_pid}"
[15] Fix | Delete
fi
[16] Fix | Delete
done;
[17] Fix | Delete
unset bad_lock_pid;
[18] Fix | Delete
done
[19] Fix | Delete
[20] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function