-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle masked spamassasin #73
Conversation
On some operating systems, systemctl returned "masked" with a new line, so we now handle this case as well
8b5aa39
to
58948f5
Compare
pleskdistup/actions/spamassassin.py
Outdated
@@ -69,8 +75,8 @@ def _post_action(self) -> action.ActionResult: | |||
return action.ActionResult() | |||
|
|||
def _revert_action(self) -> action.ActionResult: | |||
util.logged_check_call(["/usr/bin/systemctl", "enable", "spamassassin.service"]) | |||
util.logged_check_call(["/usr/bin/systemctl", "start", "spamassassin.service"]) | |||
util.logged_check_call(["/usr/bin/systemctl", "enable", self.spamassasin_service_name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't it fail here if the service is masked?
pleskdistup/actions/spamassassin.py
Outdated
# Make sure the trick is preformed before any call of 'systemctl daemon-reload' | ||
# because we change spamassassin.service configuration in scope of this action. | ||
def __init__(self) -> None: | ||
self.name = "handle spamassassin configuration update" | ||
self.spamassasin_service_name = "spamassassin.service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service has been renamed to spamd
in SpamAssassin 4, available e.g. on Debian 12, so to be future-proof it's better to make the name at least configurable.
The service has been renamed to "spamd" on some operating systems, such as Debian 12, so we need to provide an option to change the name accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase before merge.
No description provided.