From 3ae4be91af8c6b114fd6f6a343fa57a1e1a75a03 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 18 Sep 2025 12:30:22 +0500 Subject: [PATCH] debian 12 --- install/install.py | 19 ++++++++++++++----- install/installCyberPanel.py | 2 +- install/install_utils.py | 8 ++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/install/install.py b/install/install.py index cee5067f8..96ad85cf6 100644 --- a/install/install.py +++ b/install/install.py @@ -77,6 +77,13 @@ class preFlightsChecks: def is_debian_family(self): """Check if distro is Ubuntu or Debian 12""" return self.distro in [ubuntu, debian12] + + def get_service_name(self, service): + """Get the correct service name for the current distribution""" + service_map = { + 'pdns': 'pdns-server' if self.distro == debian12 else 'pdns' + } + return service_map.get(service, service) def manage_service(self, service_name, action="start"): """Unified service management""" @@ -2456,10 +2463,11 @@ milter_default_action = accept if state == 'off': - command = 'sudo systemctl stop pdns' + pdns_service = self.get_service_name('pdns') + command = f'sudo systemctl stop {pdns_service}' subprocess.call(shlex.split(command)) - command = 'sudo systemctl disable pdns' + command = f'sudo systemctl disable {pdns_service}' subprocess.call(shlex.split(command)) try: @@ -2709,12 +2717,13 @@ vmail # Start PowerDNS if it was installed if os.path.exists('/home/cyberpanel/powerdns'): preFlightsChecks.stdOut("Starting PowerDNS service...") - command = 'systemctl start pdns' + pdns_service = self.get_service_name('pdns') + command = f'systemctl start {pdns_service}' result = preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - + if result == 1: # Check if service started successfully - command = 'systemctl is-active pdns' + command = f'systemctl is-active {pdns_service}' try: output = subprocess.check_output(shlex.split(command)).decode("utf-8").strip() if output == 'active': diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 685a1baef..30b53f27c 100644 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -119,7 +119,7 @@ class InstallCyberPanel: service_map = { 'mariadb': 'mariadb', 'pureftpd': 'pure-ftpd-mysql' if self.distro == ubuntu else 'pure-ftpd', - 'pdns': 'pdns' + 'pdns': 'pdns-server' if self.distro == debian12 else 'pdns' } actual_service = service_map.get(service_name, service_name) diff --git a/install/install_utils.py b/install/install_utils.py index dd5fcd9c6..69c390773 100644 --- a/install/install_utils.py +++ b/install/install_utils.py @@ -139,7 +139,9 @@ def get_debian_mariadb_packages(): 'python-minimal': '', # Not needed in newer versions 'python-gpg': 'python3-gpg', 'python': 'python3', - 'dovecot-pigeonhole': 'dovecot-sieve' + 'dovecot-pigeonhole': 'dovecot-sieve', + 'pdns': 'pdns-server', + 'pdns-backend-mysql': 'pdns-backend-mysql' } elif debian_version >= 12.0: # Debian 12 (Bookworm) @@ -152,7 +154,9 @@ def get_debian_mariadb_packages(): 'python-minimal': '', 'python-gpg': 'python3-gpg', 'python': 'python3', - 'dovecot-pigeonhole': 'dovecot-sieve' + 'dovecot-pigeonhole': 'dovecot-sieve', + 'pdns': 'pdns-server', + 'pdns-backend-mysql': 'pdns-backend-mysql' } else: # Older Debian versions (11 and below)