From 1e0088337606801655bdaaf661cfdbaef9e0cda6 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Thu, 22 Feb 2024 11:34:39 +0200 Subject: [PATCH] Work with postfix systemd service only if it exists Actually we could remove all SMTP servers from plesk instance by plesk installer. Or don't even install any at all. So we should not interact with postfix service, therwise systemctl will fail --- pleskdistup/actions/systemd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pleskdistup/actions/systemd.py b/pleskdistup/actions/systemd.py index 4f07f2f..5c12332 100644 --- a/pleskdistup/actions/systemd.py +++ b/pleskdistup/actions/systemd.py @@ -113,7 +113,7 @@ def __init__(self): # so we should choose the right smtp service, otherwise they will conflict if systemd.is_service_exists("qmail.service"): self.plesk_systemd_services.append("qmail.service") - else: + elif systemd.is_service_exists("postfix.service"): self.plesk_systemd_services.append("postfix.service") def _prepare_action(self) -> action.ActionResult: