From 329293b182ba5e72e633a66d767a888ed201058c Mon Sep 17 00:00:00 2001 From: Paul Bourke Date: Wed, 5 Apr 2017 17:16:58 +0100 Subject: [PATCH] Make rabbitmq log dir configurable Change-Id: I020eb6219f89a310451becde41f6f1c7f54baadd Partial-Bug: #1620374 --- docker/rabbitmq/extend_start.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/rabbitmq/extend_start.sh b/docker/rabbitmq/extend_start.sh index 56d06aaf90..8c85232ed0 100644 --- a/docker/rabbitmq/extend_start.sh +++ b/docker/rabbitmq/extend_start.sh @@ -1,5 +1,7 @@ #!/bin/bash +: ${RABBITMQ_LOG_DIR:=/var/log/kolla/rabbitmq} + # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # of the KOLLA_BOOTSTRAP variable being set, including empty. if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then @@ -16,9 +18,10 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then exit 0 fi -if [[ ! -d "/var/log/kolla/rabbitmq" ]]; then - mkdir -p /var/log/kolla/rabbitmq +if [[ ! -d "${RABBITMQ_LOG_DIR}" ]]; then + mkdir -p ${RABBITMQ_LOG_DIR} fi -if [[ $(stat -c %a /var/log/kolla/rabbitmq) != "755" ]]; then - chmod 755 /var/log/kolla/rabbitmq + +if [[ $(stat -c %a ${RABBITMQ_LOG_DIR}) != "755" ]]; then + chmod 755 ${RABBITMQ_LOG_DIR} fi