Browse Source

Add creation of vhost and user to mq startup

master
Jan Dittberner 7 months ago
parent
commit
22217e06a3
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      mq/startup.sh

+ 12
- 1
mq/startup.sh View File

@@ -3,5 +3,16 @@
set -e

rabbitmq-plugins enable --offline rabbitmq_management
su -s /bin/sh -c '/usr/sbin/rabbitmq-server' rabbitmq
su -s /bin/sh -c '/usr/sbin/rabbitmq-server' rabbitmq &

sleep 5

rabbitmqctl list_users --quiet | grep -q gnuviechadmin || \
rabbitmqctl add_user gnuviechadmin ${RABBITMQ_DEFAULT_PASS}
rabbitmqctl list_vhosts --quiet | grep -q "gva" || \
rabbitmqctl add_vhost gva
rabbitmqctl set_permissions --vhost gva gnuviechadmin '.*' '.*' '.*'
rabbitmqctl shutdown

sleep 2
su -s /bin/sh -c '/usr/sbin/rabbitmq-server' rabbitmq

Loading…
Cancel
Save