From 717e8cd7f572a7a2324e56db7064107012b9cb8d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 7 Mar 2024 17:57:30 -0800 Subject: [PATCH] wordpress: Don't fail setup if mysql installed but not running Tests: - Install zoph and disable it. This will install mysql and disable it. Then install wordpress. Installation should succeed. - Disable wordpress and re-run setup. Setup should succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/wordpress/privileged.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/modules/wordpress/privileged.py b/plinth/modules/wordpress/privileged.py index 73a74adbe..dcb191562 100644 --- a/plinth/modules/wordpress/privileged.py +++ b/plinth/modules/wordpress/privileged.py @@ -36,8 +36,9 @@ def setup(): db_password = _generate_secret_key(16) _create_config_file(DB_HOST, DB_NAME, DB_USER, db_password) - _create_database(DB_NAME) - _set_privileges(DB_HOST, DB_NAME, DB_USER, db_password) + with action_utils.service_ensure_running('mysql'): + _create_database(DB_NAME) + _set_privileges(DB_HOST, DB_NAME, DB_USER, db_password) def _create_config_file(db_host, db_name, db_user, db_password):