plinth: Fix disable daemon when service alias is provided

Fixes the issue that after disabling an app which has a daemon alias,
only the alias was disabled and the real service kept still running.

Closes #2019

Test on Debian testing: After disabling the bind app,
check that both 'bind9' and 'named' services are not running.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa 2021-01-24 10:59:15 +02:00 committed by Sunil Mohan Adapa
parent 37a38549bf
commit 8d57aca6d1
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -76,6 +76,8 @@ class Daemon(app.LeaderComponent):
def disable(self):
"""Run operations to disable the daemon/unit."""
actions.superuser_run('service', ['disable', self.unit])
if self.alias:
actions.superuser_run('service', ['disable', self.alias])
def is_running(self):
"""Return whether the daemon/unit is running."""