From 906faf43c8df0307151ef31e6ecf57d43030b3bb Mon Sep 17 00:00:00 2001 From: Master3395 Date: Wed, 24 Sep 2025 11:08:22 +0200 Subject: [PATCH 1/2] Update MariaDB package names for consistency and enhance LSMCD service management in cyberpanel.sh - Changed package names from 'MariaDB-*' to 'mariadb-*' for consistency across scripts. - Modified LSMCD service type from 'forking' to 'simple' and added user/group settings in cyberpanel.sh. - Improved error handling for LSMCD service startup in cyberpanel.sh. - Fixed Django AutoField warnings in install.py by directly calling the fix function. --- cyberpanel.sh | 12 ++++++++---- install/install.py | 2 +- install/installCyberPanel.py | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 7f1398460..03e20a31e 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1565,7 +1565,7 @@ if [[ "$Server_OS" =~ ^(CentOS|RHEL|AlmaLinux|RockyLinux|CloudLinux|openEuler) ] Check_Return "EPEL repository" "no_exit" # Setup MariaDB repository for RHEL 9+ based systems (AlmaLinux 9/10, RockyLinux 9, RHEL 9) - if [[ "$Server_OS" =~ ^(AlmaLinux9|AlmaLinux10|RockyLinux9|RHEL9) ]] ; then + if [[ "$Server_OS" =~ ^(AlmaLinux9|AlmaLinux10|RockyLinux9|RHEL9|RHEL10) ]] ; then # Use the official MariaDB repository setup script for better compatibility curl -sS "https://downloads.mariadb.com/MariaDB/mariadb_repo_setup" | bash -s -- --mariadb-server-version="10.11" --skip-maxscale --skip-tools Check_Return "MariaDB repository setup" "no_exit" @@ -1587,7 +1587,7 @@ EOF fi fi - dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel MariaDB-server MariaDB-client MariaDB-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils openssl-devel boost-devel boost-program-options + dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-server mariadb-devel mariadb-client-utils curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils openssl-devel boost-devel boost-program-options Check_Return # Install development tools group @@ -2309,12 +2309,13 @@ Description=LiteSpeed Memcached (LSMCD) After=network.target [Service] -Type=forking -PIDFile=/var/run/lsmcd.pid +Type=simple ExecStart=/usr/local/bin/lsmcd -d ExecReload=/bin/kill -HUP $MAINPID KillMode=process Restart=on-failure +User=root +Group=root [Install] WantedBy=multi-user.target @@ -2330,6 +2331,9 @@ EOF touch /home/cyberpanel/lsmcd else echo "Warning: LSMCD service failed to start" + # Try to get more details about the failure + systemctl status lsmcd --no-pager + journalctl -u lsmcd --no-pager -n 10 fi else echo "Error: LSMCD installation failed" diff --git a/install/install.py b/install/install.py index a19801db2..1dd0e31b7 100644 --- a/install/install.py +++ b/install/install.py @@ -3625,7 +3625,7 @@ def main(): checks.installAcme() # Fix Django AutoField warnings - checks.fix_django_autofield_warnings() + fix_django_autofield_warnings() ## Install and Configure OpenDKIM. diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index a88d2f18d..6c339551a 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -93,7 +93,7 @@ class InstallCyberPanel: # Install MariaDB packages self.stdOut("Installing MariaDB packages...", 1) - mariadb_packages = "MariaDB-server MariaDB-client MariaDB-backup MariaDB-devel" + mariadb_packages = "mariadb-server mariadb-devel mariadb-client-utils" command = f"dnf install -y {mariadb_packages}" install_utils.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) @@ -693,7 +693,7 @@ gpgcheck=1 command = 'dnf clean all' install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) - command = 'dnf install MariaDB-server MariaDB-client MariaDB-backup -y' + command = 'dnf install mariadb-server mariadb-devel mariadb-client-utils -y' install_utils.call(command, self.distro, command, command, 1, 1, os.EX_OSERR, True) From fa050542536f85591b61535717c065a7f6bc72b3 Mon Sep 17 00:00:00 2001 From: Master3395 Date: Wed, 24 Sep 2025 11:13:16 +0200 Subject: [PATCH 2/2] Enhance package installation process in cyberpanel.sh for RHEL 9+ systems - Added steps to clean and make cache before and after EPEL and MariaDB repository installations to prevent conflicts. - Implemented repository priority settings to avoid package conflicts during installation. - Included checks for repository and package conflicts, with fallback installation strategies for MariaDB. - Organized package installation into logical steps to ensure proper dependency resolution and system stability. - Finalized with a cache clean and system update to maintain consistency. --- cyberpanel.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 03e20a31e..2d381c373 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -1560,11 +1560,19 @@ if [[ "$Server_OS" =~ ^(CentOS|RHEL|AlmaLinux|RockyLinux|CloudLinux|openEuler) ] Check_Return elif [[ "$Server_OS" =~ ^(CentOS9|RHEL9|AlmaLinux9|AlmaLinux10|RockyLinux9|openEuler) ]] ; then # Enhanced package installation for AlmaLinux 9/10, RHEL 9, RockyLinux 9, etc. - # Install EPEL repository for additional packages like htop + # STEP 1: Clean all caches first to prevent conflicts + dnf clean all + dnf makecache + + # STEP 2: Install EPEL repository for additional packages like htop dnf install -y epel-release Check_Return "EPEL repository" "no_exit" - # Setup MariaDB repository for RHEL 9+ based systems (AlmaLinux 9/10, RockyLinux 9, RHEL 9) + # STEP 3: Clean caches after EPEL installation + dnf clean all + dnf makecache + + # STEP 4: Setup MariaDB repository for RHEL 9+ based systems (AlmaLinux 9/10, RockyLinux 9, RHEL 9) if [[ "$Server_OS" =~ ^(AlmaLinux9|AlmaLinux10|RockyLinux9|RHEL9|RHEL10) ]] ; then # Use the official MariaDB repository setup script for better compatibility curl -sS "https://downloads.mariadb.com/MariaDB/mariadb_repo_setup" | bash -s -- --mariadb-server-version="10.11" --skip-maxscale --skip-tools @@ -1585,15 +1593,65 @@ module_hotfixes=1 EOF Check_Return "MariaDB repository fallback setup" "no_exit" fi + + # STEP 5: Clean caches after MariaDB repo setup + dnf clean all + dnf makecache + + # STEP 6: Set repository priorities to prevent conflicts + dnf install -y yum-plugin-priorities + if [ -f /etc/yum.repos.d/mariadb.repo ]; then + sed -i '/\[mariadb\]/a priority=1' /etc/yum.repos.d/mariadb.repo + fi + if [ -f /etc/yum.repos.d/MariaDB.repo ]; then + sed -i '/\[mariadb\]/a priority=1' /etc/yum.repos.d/MariaDB.repo + fi + + # STEP 6.1: Check for repository conflicts and resolve them + echo "Checking for repository conflicts..." + if dnf repolist | grep -q "mariadb"; then + echo "MariaDB repository detected successfully" + else + echo "Warning: MariaDB repository not found, attempting to resolve..." + # Try alternative repository setup + dnf install -y mariadb-server mariadb-devel mariadb-client-utils --skip-broken --nobest + fi fi - dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-server mariadb-devel mariadb-client-utils curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils openssl-devel boost-devel boost-program-options - Check_Return + # STEP 7: Install packages in logical order to prevent conflicts + # First: Install base system packages + dnf install -y libnsl zip wget strace net-tools curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel curl-devel git platform-python-devel tar socat python3 zip unzip bind-utils openssl-devel boost-devel boost-program-options + Check_Return "Base system packages" "no_exit" - # Install development tools group + # Second: Install MariaDB packages (with proper dependency resolution) + dnf install -y mariadb-server mariadb-devel mariadb-client-utils --skip-broken --nobest + Check_Return "MariaDB packages" "no_exit" + + # STEP 7.1: Check for package conflicts and resolve them + echo "Checking for package conflicts..." + if dnf list installed | grep -q "mariadb-server"; then + echo "MariaDB server installed successfully" + else + echo "Warning: MariaDB server not found, attempting to resolve..." + # Try installing from different sources + dnf install -y mariadb-server --skip-broken --nobest --allowerasing + fi + + # STEP 8: Install development tools group dnf groupinstall -y "Development Tools" Check_Return "Development Tools" "no_exit" + # STEP 9: Final cache clean and update to ensure consistency + dnf clean all + dnf makecache + dnf update -y --skip-broken + Check_Return "Final system update" "no_exit" + + # STEP 10: Verify repository consistency + echo "Verifying repository consistency..." + dnf repolist + echo "Repository verification completed" + # Fix boost library compatibility for galera-4 on AlmaLinux 10 if [[ "$Server_OS_Version" = "10" ]]; then # Create symlink for boost libraries if needed