From 17822bcd276f2f9db69930681c0e562eabcb1eb7 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Mon, 29 Jul 2024 14:01:19 +0300 Subject: [PATCH] Do not start mysqld service if mariadb service is listed in services This is to prevent issues with linked units in systemd --- pleskdistup/actions/systemd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pleskdistup/actions/systemd.py b/pleskdistup/actions/systemd.py index eb930e6..b8df658 100644 --- a/pleskdistup/actions/systemd.py +++ b/pleskdistup/actions/systemd.py @@ -154,7 +154,6 @@ def __init__(self) -> None: self.name = "starting plesk services" self.plesk_basic_services = [ "mariadb.service", - "mysqld.service", "plesk-task-manager.service", "plesk-web-socket.service", "sw-cp-server.service", @@ -162,6 +161,11 @@ def __init__(self) -> None: ] self.plesk_basic_services = [service for service in self.plesk_basic_services if systemd.is_service_exists(service)] + # Once MariaDB has started, systemctl will not be able to control mysqld as a linked unit. + # Therefore, we should manage mysqld separately and only if MariaDB is not present + if "mariadb.service" not in self.plesk_basic_services and systemd.is_service_startable("mysqld.service"): + self.plesk_basic_services.append("mysqld.service") + def _enable_services(self) -> action.ActionResult: # MariaDB could be started before, so we should stop it first # TODO. Or we could check it is started and just remove it from list