From d79ba1cede89e1e1c686915f67f5c70b39c0169a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 7 Mar 2024 17:56:11 -0800 Subject: [PATCH] zoph: Don't fail setup if mysql installed but not running Tests: - Install wordpress and disable it. This will install mysql and disable it. Then install zoph installation should succeed. - Disable zoph and re-run setup. Setup should succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/zoph/privileged.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/plinth/modules/zoph/privileged.py b/plinth/modules/zoph/privileged.py index e5f3b79b9..67e386a48 100644 --- a/plinth/modules/zoph/privileged.py +++ b/plinth/modules/zoph/privileged.py @@ -42,16 +42,20 @@ def _zoph_configure(key, value): @privileged def setup(): - """Setup Zoph configuration.""" - _zoph_configure('import.enable', 'true') - _zoph_configure('import.upload', 'true') - _zoph_configure('import.rotate', 'true') - _zoph_configure('path.unzip', 'unzip') - _zoph_configure('path.untar', 'tar xvf') - _zoph_configure('path.ungz', 'gunzip') + """Setup Zoph configuration. - # Maps using OpenStreetMap is enabled by default. - _zoph_configure('maps.provider', 'osm') + May be called when app is disabled. + """ + with action_utils.service_ensure_running('mysql'): + _zoph_configure('import.enable', 'true') + _zoph_configure('import.upload', 'true') + _zoph_configure('import.rotate', 'true') + _zoph_configure('path.unzip', 'unzip') + _zoph_configure('path.untar', 'tar xvf') + _zoph_configure('path.ungz', 'gunzip') + + # Maps using OpenStreetMap is enabled by default. + _zoph_configure('maps.provider', 'osm') def _get_db_name():