Make redis available before we deploy modoboa

This commit is contained in:
Antoine Nguyen
2024-01-12 17:33:29 +01:00
parent e7995ada3f
commit 715a5e3c8f

View File

@@ -303,16 +303,18 @@ class Modoboa(base.Installer):
def post_run(self): def post_run(self):
"""Additional tasks.""" """Additional tasks."""
if 'centos' in utils.dist_name():
system.enable_and_start_service("redis")
else:
system.enable_and_start_service("redis-server")
self._deploy_instance() self._deploy_instance()
if not self.upgrade: if not self.upgrade:
self.apply_settings() self.apply_settings()
if 'centos' in utils.dist_name(): if 'centos' in utils.dist_name():
supervisor = "supervisord" supervisor = "supervisord"
system.enable_and_start_service("redis")
else: else:
supervisor = "supervisor" supervisor = "supervisor"
system.enable_and_start_service("redis-server")
# Restart supervisor # Restart supervisor
system.enable_service(supervisor) system.enable_service(supervisor)
utils.exec_cmd("service {} stop".format(supervisor)) utils.exec_cmd("service {} stop".format(supervisor))