From a75c1da6830cf068c9e4675900175ee902d6142c Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Thu, 6 Feb 2020 11:25:49 +0200 Subject: [PATCH] service: Stop service not before but after disabling it Services that have socket activation enabled (e.g avahi) could automatically start again after they are stopped manually. This change disables service before stopping it, preventing it from auto-starting again. Closes #1772 Signed-off-by: Veiko Aasa Reviewed-by: James Valleroy --- plinth/action_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/action_utils.py b/plinth/action_utils.py index caa0a2754..1a1b87c49 100644 --- a/plinth/action_utils.py +++ b/plinth/action_utils.py @@ -84,11 +84,11 @@ def service_enable(service_name): def service_disable(service_name): """Disable and stop service in systemd and sysvinit using update-rc.d.""" + subprocess.call(['systemctl', 'disable', service_name]) try: service_stop(service_name) except subprocess.CalledProcessError: pass - subprocess.call(['systemctl', 'disable', service_name]) def service_unmask(service_name):