|
|
@@ -6,6 +6,10 @@
|
|
|
#
|
|
|
# This function reloads backend server configuration.
|
|
|
|
|
|
+restart=$1
|
|
|
+# For backward compatibility might change in the feature
|
|
|
+version=$2
|
|
|
+
|
|
|
#----------------------------------------------------------#
|
|
|
# Variables & Functions #
|
|
|
#----------------------------------------------------------#
|
|
|
@@ -47,20 +51,30 @@ if [ "$1" = 'scheduled' ] || [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; th
|
|
|
fi
|
|
|
|
|
|
tmpfile=$(mktemp)
|
|
|
-# Substitute php-fpm service name formats
|
|
|
-for version in $($BIN/v-list-sys-php plain); do
|
|
|
- v_php="php$version-fpm"
|
|
|
- if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then
|
|
|
- cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/"
|
|
|
- sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf"
|
|
|
- fi
|
|
|
|
|
|
- $BIN/v-restart-service "$v_php" "$1" >> $tmpfile 2>&1
|
|
|
+if [ -z "$version" ]; then
|
|
|
+ # Substitute php-fpm service name formats
|
|
|
+ for version in $($BIN/v-list-sys-php plain); do
|
|
|
+ v_php="php$version-fpm"
|
|
|
+ if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then
|
|
|
+ cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/"
|
|
|
+ sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf"
|
|
|
+ fi
|
|
|
+
|
|
|
+ $BIN/v-restart-service "$v_php" "$restart"
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
+ send_email_report
|
|
|
+ check_result "$E_RESTART" "$v_php restart failed"
|
|
|
+ fi
|
|
|
+ done
|
|
|
+else
|
|
|
+ v_php="php$version-fpm"
|
|
|
+ $BIN/v-restart-service "$v_php" "$restart"
|
|
|
if [ $? -ne 0 ]; then
|
|
|
send_email_report
|
|
|
check_result "$E_RESTART" "$v_php restart failed"
|
|
|
fi
|
|
|
-done
|
|
|
+fi
|
|
|
|
|
|
# Update restart queue
|
|
|
if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
|