From 3172c6a7b43ac12062f033346f01997e01e93faa Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 26 Jul 2023 18:27:30 -0700 Subject: [PATCH] infinoted: Don't enable app when setup is rerun Tests: - When app is freshly installed, app is enabled. - Rerun setup after disabling the app. App is not enabled. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/infinoted/__init__.py | 3 ++- plinth/modules/infinoted/privileged.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/plinth/modules/infinoted/__init__.py b/plinth/modules/infinoted/__init__.py index f00338e11..aa0b6f884 100644 --- a/plinth/modules/infinoted/__init__.py +++ b/plinth/modules/infinoted/__init__.py @@ -77,7 +77,8 @@ class InfinotedApp(app_module.App): """Install and configure the app.""" super().setup(old_version) privileged.setup() - self.enable() + if not old_version: + self.enable() def uninstall(self): """De-configure and uninstall the app.""" diff --git a/plinth/modules/infinoted/privileged.py b/plinth/modules/infinoted/privileged.py index a9a125d7c..c37f4680e 100644 --- a/plinth/modules/infinoted/privileged.py +++ b/plinth/modules/infinoted/privileged.py @@ -9,7 +9,6 @@ import shutil import subprocess import time -from plinth import action_utils from plinth.actions import privileged DATA_DIR = '/var/lib/infinoted' @@ -167,8 +166,6 @@ def setup(): shutil.chown(KEY_DIR + '/infinoted-key.pem', user='infinoted', group='infinoted') - action_utils.service_enable('infinoted') - @privileged def uninstall():