From 38c458e35a181e9cced957d733832c1e297e2e35 Mon Sep 17 00:00:00 2001 From: Stepan Andrushko Date: Tue, 19 Feb 2019 19:14:55 +0200 Subject: Yardstick container rabbitmq supervisor RUN state Rabbitmq process exited supervisor and couldn't respawn it afterwards. Updated the way rabbitmq service and node are spawned to have them RUNNING after a service stop or node down. JIRA: YARDSTICK-1600 Change-Id: Idd6812db7a1985e8c727efd7ea45572199c1a4a9 Signed-off-by: Stepan Andrushko --- .../configure_rabbitmq/templates/rabbitmq.sh.j2 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ansible/roles/configure_rabbitmq/templates/rabbitmq.sh.j2 (limited to 'ansible/roles/configure_rabbitmq/templates') diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.sh.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.sh.j2 new file mode 100644 index 000000000..a91565c01 --- /dev/null +++ b/ansible/roles/configure_rabbitmq/templates/rabbitmq.sh.j2 @@ -0,0 +1,20 @@ +#!/bin/bash +trap "rabbitmqctl stop_app" EXIT + +rabbitmqctl stop_app +service rabbitmq-server restart +rabbitmqctl start_app + +tmp_file="/tmp/$(basename -- $0).configured" +if [ ! -f "$tmp_file" ]; then + rabbitmqctl add_user yardstick yardstick + rabbitmqctl set_permissions -p / yardstick '.*' '.*' '.*' + touch "$tmp_file" +fi + +while : +do + sleep 5 + service rabbitmq-server status > /dev/null 2>&1 || exit 1 + rabbitmqctl report | grep "Status of node rabbit@`hostname`" > /dev/null 2>&1 || exit 1 +done -- cgit 1.2.3-korg