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 authored and Sunil Mohan Adapa committed 2021-01-25 10:53:01 -08:00
1 parent 37a38549bf
commit 8d57aca6d1
1 file changed
+2
+2
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."""