Fixes for php-fpm service
This commit is contained in:
@@ -21,6 +21,12 @@ source $HESTIA/func/main.sh
|
||||
# load config file
|
||||
source_conf "$HESTIA/conf/hestia.conf"
|
||||
source_conf "$HESTIA/install/upgrade/upgrade.conf"
|
||||
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
for elem in "${!multiphp_v[@]}"; do
|
||||
multiphp_v[$elem]=$(convert_dot_version_to_non_dot "${multiphp_v[$elem]}")
|
||||
done
|
||||
fi
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
39
bin/v-oneshot-service
Executable file
39
bin/v-oneshot-service
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# info: prepare actions befor whole system will start
|
||||
# options: NONE
|
||||
#
|
||||
# example: v-oneshot-service
|
||||
#
|
||||
# This function prepares dir structure for such things
|
||||
# wich deleted on system shoutdown, run as root only
|
||||
|
||||
# Includes
|
||||
# shellcheck source=/etc/hestiacp/hestia.conf
|
||||
source /etc/hestiacp/hestia.conf
|
||||
# shellcheck source=/usr/local/hestia/func/main.sh
|
||||
source $HESTIA/func/main.sh
|
||||
# load config file
|
||||
source_conf "$HESTIA/conf/hestia.conf"
|
||||
|
||||
# Checking root permissions
|
||||
if [ "$(id -u)" != '0' ]; then
|
||||
echo "Error: Script can be run executed only by root"
|
||||
exit 10
|
||||
fi
|
||||
|
||||
php_DIR="/run/php"
|
||||
#make php directory in /var/run/directory for php-fpm
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
user_apache=$(cat $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl | grep listen.group | cut -d= -f2 | xargs)
|
||||
if [ -n "$user_apache" ]; then
|
||||
if grep "$user_apache" /etc/passwd; then
|
||||
if grep "$user_apache" /etc/group; then
|
||||
if [ ! -e "$php_DIR" ]; then
|
||||
mkdir "$php_DIR"
|
||||
chmod 755 "$php_DIR"
|
||||
chown "$user_apache":"$user_apache" "$php_DIR"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -9,6 +9,9 @@
|
||||
restart=$1
|
||||
# For backward compatibility might change in the feature
|
||||
version=$2
|
||||
if [ -f "/etc/redhat-release" ]; then
|
||||
version="${version//./}"
|
||||
fi
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variables & Functions #
|
||||
@@ -55,10 +58,21 @@ tmpfile=$(mktemp)
|
||||
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"
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
v_php="php$version-php-fpm"
|
||||
else
|
||||
v_php="php$version-fpm"
|
||||
fi
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
if [ ! -f "/etc/opt/remi/php${version}/php-fpm.d/dummy.conf" ]; then
|
||||
cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/opt/remi/php${version}/php-fpm.d/
|
||||
sed -i "s/9999/99$v_tpl/g" /etc/opt/remi/php${version}/php-fpm.d/dummy.conf
|
||||
fi
|
||||
else
|
||||
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
|
||||
fi
|
||||
|
||||
$BIN/v-restart-service "$v_php" "$restart"
|
||||
@@ -68,7 +82,11 @@ if [ -z "$version" ]; then
|
||||
fi
|
||||
done
|
||||
else
|
||||
v_php="php$version-fpm"
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
v_php="php$version-php-fpm"
|
||||
else
|
||||
v_php="php$version-fpm"
|
||||
fi
|
||||
$BIN/v-restart-service "$v_php" "$restart"
|
||||
if [ $? -ne 0 ]; then
|
||||
send_email_report
|
||||
|
||||
Reference in New Issue
Block a user