From 000be3e02d93e0e5974bcc0675317a71c34237ca Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Wed, 27 Nov 2024 09:49:44 +0530 Subject: [PATCH] Add requires to Notifier service Autostart of mix of service dependencies resulted in panic mode pebble, see bug [1] As a workaround, add Requires to notifier service definition. [1] https://github.com/canonical/pebble/issues/525 --- src/charm.py | 3 +++ tests/unit/test_charm.py | 1 + 2 files changed, 4 insertions(+) diff --git a/src/charm.py b/src/charm.py index bd27d9e..8722d9d 100755 --- a/src/charm.py +++ b/src/charm.py @@ -306,6 +306,9 @@ def _rabbitmq_layer(self) -> dict: "summary": "Pebble notifier", "command": "/usr/bin/notifier", "startup": "enabled", + # Workaround to avoid bug + # https://github.com/canonical/pebble/issues/525 + "requires": [RABBITMQ_SERVICE], }, }, } diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index e7fc662..08c9e99 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -90,6 +90,7 @@ def test_rabbitmq_pebble_ready(self): "override": "replace", "startup": "enabled", "summary": "Pebble notifier", + "requires": ["rabbitmq"], }, "epmd": { "override": "replace",