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 <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-04-01 15:23:49 -07:00 committed by James Valleroy
parent 52c4783c4a
commit da3f498609
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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()