From 3eaf974c8f467ad65fc9a345b63cb117e2c1889c Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Wed, 1 May 2024 23:32:47 +0300 Subject: [PATCH] Added fixes in rpm install --- bin/v-oneshot-service | 15 ++++++++++++--- install/hst-install-rhel.sh | 4 ++++ src/rpm/nginx/nginx.conf | 2 +- src/rpm/php/hestia-php.service | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/bin/v-oneshot-service b/bin/v-oneshot-service index 6d2805a..a1028e8 100755 --- a/bin/v-oneshot-service +++ b/bin/v-oneshot-service @@ -22,12 +22,12 @@ if [ "$(id -u)" != '0' ]; then fi php_DIR="/run/php" -#make php directory in /var/run/directory for php-fpm +#make php directory in /var/run/directory for php-fpm and for hestia-php 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 grep -q "$user_apache" /etc/passwd; then + if grep -q "$user_apache" /etc/group; then if [ ! -e "$php_DIR" ]; then mkdir "$php_DIR" chmod 755 "$php_DIR" @@ -36,4 +36,13 @@ if [ -f /etc/redhat-release ]; then fi fi fi + if [ ! -e /run/hestia ]; then + mkdir /run/hestia + chown admin:admin /run/hestia + else + own=$(stat -c "%U:%G" /run/hestia) + if [ "$own" != "admin:admin" ]; then + chown admin:admin /run/hestia + fi + fi fi \ No newline at end of file diff --git a/install/hst-install-rhel.sh b/install/hst-install-rhel.sh index 5babc2a..fa833ff 100755 --- a/install/hst-install-rhel.sh +++ b/install/hst-install-rhel.sh @@ -689,6 +689,8 @@ dnf install -y https://rpms.remirepo.net/enterprise/remi-release-$release.rpm if [ "$mysql" = 'yes' ]; then echo "[ * ] MariaDB" dnf config-manager --add-repo https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/rpm/mysql/mariadb-$(arch).repo + mkdir /var/log/mysql/ + chown mysql:mysql /var/log/mysql/ fi # Enabling MySQL module @@ -704,6 +706,8 @@ echo "[ * ] Hestia Control Panel" dnf config-manager --add-repo https://dev.putey.net/bayrepo/hestiacp/raw/branch/master/install/rpm/hestia/hestia.repo rpm --import https://repo.putey.net/repo/gpgkeys/repo.putey.net.pub check_result $? "rpm import putey.net GPG key failed" +mkdir /var/cache/hestia-nginx/ +chown admin:admin /var/cache/hestia-nginx/ # Installing PostgreSQL repo if [ "$postgresql" = 'yes' ]; then diff --git a/src/rpm/nginx/nginx.conf b/src/rpm/nginx/nginx.conf index 54612d6..efd5a1a 100644 --- a/src/rpm/nginx/nginx.conf +++ b/src/rpm/nginx/nginx.conf @@ -163,7 +163,7 @@ http { include fastcgi_params; fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty; fastcgi_param SCRIPT_FILENAME /usr/local/hestia/web/fm/dist/index.php; - fastcgi_pass unix:/run/hestia-php.sock; + fastcgi_pass unix:/run/hestia/php.sock; fastcgi_index index.php; } } diff --git a/src/rpm/php/hestia-php.service b/src/rpm/php/hestia-php.service index ca8c474..38a2fe5 100644 --- a/src/rpm/php/hestia-php.service +++ b/src/rpm/php/hestia-php.service @@ -6,7 +6,7 @@ PartOf=hestia.service [Service] Type=forking PIDFile=/run/hestia/php.pid -ExecStart=/usr/local/hestia/php/sbin/hestia-php --fpm-config /usr/local/hestia/php/etc/php-fpm.conf +ExecStart=/usr/local/hestia/php/sbin/php-fpm --fpm-config /usr/local/hestia/php/etc/php-fpm.conf ExecReload=/bin/kill -USR2 $MAINPID ExecStop=/bin/kill -TERM $MAINPID ExecStartPre=/bin/bash -c "/bin/systemctl set-environment HOSTNAME=$(/usr/bin/hostname)"