Skip to content

Commit

Permalink
Fix fail on checking if disabled service is masked
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sandakov committed Mar 28, 2024
1 parent 3ba57dc commit 0fe9465
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pleskdistup/common/src/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ def is_service_masked(service: str) -> bool:
[SYSTEMCTL_BIN_PATH, 'is-enabled', service],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
universal_newlines=True
)
# Because disabled service is not masked
if res.returncode != 0:
return False

if res.stdout == 'masked':
return True
return False
Expand Down

0 comments on commit 0fe9465

Please sign in to comment.