Skip to content

Commit

Permalink
Merge pull request #94 from plesk/avoid-stop-mariadb-on-revert-when-i…
Browse files Browse the repository at this point in the history
…t-absent

Stop the MariaDB service on revert only if it exists
  • Loading branch information
SandakovMM authored Dec 4, 2024
2 parents 240a7b3 + d073fca commit 8ff8354
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pleskdistup/actions/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ def __init__(self) -> None:
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
util.logged_check_call(["/usr/bin/systemctl", "stop", "mariadb.service"])
if systemd.is_service_exists("mariadb.service"):
util.logged_check_call(["/usr/bin/systemctl", "stop", "mariadb.service"])

util.logged_check_call(["/usr/bin/systemctl", "enable"] + self.plesk_basic_services)
util.logged_check_call(["/usr/bin/systemctl", "start"] + self.plesk_basic_services)
Expand Down

0 comments on commit 8ff8354

Please sign in to comment.