3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

[fix] stop PHP-FPM before modifications

This commit is contained in:
Ramil Valitov 2020-07-07 21:17:21 +03:00
parent 6f0bea84df
commit d53e9293b7
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -111,6 +111,17 @@ setupPool() {
setupPools() { setupPools() {
PHP_LIST=$(sudo find /etc/php/ -name 'www.conf' -type f) PHP_LIST=$(sudo find /etc/php/ -name 'www.conf' -type f)
#First we need to stop all PHP-FPM
while IFS= read -r pool; do
if [[ -n $pool ]]; then
POOL_DIR=$(dirname "$pool")
PHP_VERSION=$(echo "$POOL_DIR" | grep -oP "(\d\.\d)")
sudo service "php${PHP_VERSION}-fpm" stop
fi
done <<<"$PHP_LIST"
#Now we reconfigure them and restart
while IFS= read -r pool; do while IFS= read -r pool; do
if [[ -n $pool ]]; then if [[ -n $pool ]]; then
setupPool "$pool" setupPool "$pool"