Do not reload php-fpm if conf breaks it (#1087)

This commit is contained in:
Alexandre Aubin 2020-11-30 23:20:45 +01:00 committed by GitHub
parent 74272de52c
commit b07fc2061a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,7 +256,13 @@ WantedBy=multi-user.target
# Restart the service, as this service is either stopped or only for this app
ynh_systemd_action --service_name=$fpm_service --action=restart
else
# Reload PHP, to not impact other parts of the system using PHP
# Validate that the new php conf doesn't break php-fpm entirely
php-fpm${phpversion} --test 2>/dev/null \
&& ynh_systemd_action --service_name=$fpm_service --action=reload \
|| { php-fpm${phpversion} --test || true;
ynh_secure_remove --file="$finalphpconf";
ynh_die --message="The new configuration broke php-fpm?"
}
ynh_systemd_action --service_name=$fpm_service --action=reload
fi
}