From 763b555e83e424ad68272ef57297c8dac8d711d7 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 9 Jan 2025 19:49:02 -0800 Subject: [PATCH] miniflux: Add management of postgresql daemon in a shared manner - This allows miniflux to disabled postgresql if it is not needed by any other app and enable postgresql if it is disabled and miniflux is being enabled. Tests: - When disabling miniflux and it is the last app using postgresql, it will be disabled too. - When disabling miniflux and it is not the last app using postgresql, it will not be disabled too. - When enabling miniflux if postgresql is disabled, it will be enabled too. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/miniflux/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plinth/modules/miniflux/__init__.py b/plinth/modules/miniflux/__init__.py index 223cc1d72..ab1461d53 100644 --- a/plinth/modules/miniflux/__init__.py +++ b/plinth/modules/miniflux/__init__.py @@ -6,7 +6,7 @@ from django.utils.translation import gettext_lazy as _ from plinth import app as app_module from plinth import frontpage, menu from plinth.config import DropinConfigs -from plinth.daemon import Daemon +from plinth.daemon import Daemon, SharedDaemon from plinth.modules.apache.components import Webserver from plinth.modules.backups.components import BackupRestore from plinth.modules.firewall.components import Firewall @@ -74,6 +74,10 @@ class MinifluxApp(app_module.App): urls=['https://{host}/miniflux/']) self.add(webserver) + daemon = SharedDaemon('shared-daemon-miniflus-postgresql', + 'postgresql') + self.add(daemon) + daemon = Daemon('daemon-miniflux', 'miniflux', listen_ports=[(8788, 'tcp4'), (8788, 'tcp6')]) self.add(daemon)