From c341a531ddea818fcba301169be2ee176590b6d1 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 8 Mar 2024 14:58:03 -0800 Subject: [PATCH] zoph: Ensure that database server is running when setting up app When mysql server is not running, app installation fails. Similarly the setup process will fail when app is being upgrade and database upgrade needs to be performed. So, ensure that database server is running before attempting install/upgrade of app. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/zoph/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plinth/modules/zoph/__init__.py b/plinth/modules/zoph/__init__.py index 0197788a6..1008272dc 100644 --- a/plinth/modules/zoph/__init__.py +++ b/plinth/modules/zoph/__init__.py @@ -102,7 +102,11 @@ class ZophApp(app_module.App): def setup(self, old_version): """Install and configure the app.""" privileged.pre_install() - super().setup(old_version) + with self.get_component('shared-daemon-zoph-mysql').ensure_running(): + # Database needs to be running for successful initialization or + # upgrade of zoph database. + super().setup(old_version) + privileged.setup() if not old_version: self.enable()