From da3f498609811679aeee9b04e0837339852691a4 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 1 Apr 2024 15:23:49 -0700 Subject: [PATCH] nextcloud: Ensure that database is running when running setup - Database will be running if mysql has just been installed. - However, after disabling all apps, it is no longer running. After this trying to install/reinstall nextcloud fails. Fix this by ensuring that mysql is always running during setup. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/nextcloud/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plinth/modules/nextcloud/__init__.py b/plinth/modules/nextcloud/__init__.py index 6c31b63fb..8803e5598 100644 --- a/plinth/modules/nextcloud/__init__.py +++ b/plinth/modules/nextcloud/__init__.py @@ -114,7 +114,12 @@ class NextcloudApp(app_module.App): def setup(self, old_version): """Install and configure the app.""" super().setup(old_version) - privileged.setup() + with self.get_component( + 'shared-daemon-nextcloud-mysql').ensure_running(): + # Database needs to be running for successful initialization or + # upgrade of Nextcloud database. + privileged.setup() + if not old_version: self.enable()