diff --git a/src/charm.py b/src/charm.py index 101bf00..080d1c0 100755 --- a/src/charm.py +++ b/src/charm.py @@ -239,6 +239,10 @@ def _check_rmq_running(): def _rabbitmq_layer(self) -> dict: """Pebble layer definition for RabbitMQ.""" + # NOTE(jamespage) + # Use the full path to the rabbitmq-server binary + # rather than the helper wrapper script to avoid + # redirection of console output to a log file. return { "summary": "RabbitMQ layer", "description": "pebble config layer for RabbitMQ", @@ -246,7 +250,7 @@ def _rabbitmq_layer(self) -> dict: RABBITMQ_SERVICE: { "override": "replace", "summary": "RabbitMQ Server", - "command": "rabbitmq-server", + "command": "/usr/lib/rabbitmq/bin/rabbitmq-server", "startup": "enabled", "user": RABBITMQ_USER, "group": RABBITMQ_GROUP, @@ -744,6 +748,10 @@ def _render_and_push_rabbitmq_conf(self) -> None: cluster_partition_handling = autoheal queue_master_locator = min-masters + +# Log to console for pod logging +log.console = true +log.file = false """ logger.info("Pushing new rabbitmq.conf") container.push( diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index 19b94f7..755ba6c 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -76,7 +76,7 @@ def test_rabbitmq_pebble_ready(self): "rabbitmq": { "override": "replace", "summary": "RabbitMQ Server", - "command": "rabbitmq-server", + "command": "/usr/lib/rabbitmq/bin/rabbitmq-server", "startup": "enabled", "user": "rabbitmq", "group": "rabbitmq",