Skip to content

Commit

Permalink
Do not start mysqld service if mariadb service is listed in services
Browse files Browse the repository at this point in the history
This is to prevent issues with linked units in systemd
  • Loading branch information
Mikhail Sandakov committed Jul 29, 2024
1 parent ac2c825 commit e1fe9b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pleskdistup/actions/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,18 @@ 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",
"sw-engine.service",
]
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
Expand Down

0 comments on commit e1fe9b6

Please sign in to comment.