LXCize RabbitMQ setup
This commit is contained in:
parent
677ac1bc4c
commit
0fda481317
@ -17,4 +17,5 @@ EOF
|
||||
MOUNT /srv/rabbitmq/data var/lib/rabbitmq/mnesia
|
||||
|
||||
USER 5672 5672
|
||||
ENV HOME /usr/lib/rabbitmq
|
||||
CMD /usr/sbin/rabbitmq-server
|
||||
|
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/rabbitmq
|
||||
|
||||
# Build Docker container
|
||||
docker build -t rabbitmq ${SOURCE_DIR}
|
||||
cp ${SOURCE_DIR}/etc/init.d/rabbitmq /etc/init.d/rabbitmq
|
||||
rc-update -u
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||
|
||||
# Create RabbitMQ directory structure
|
||||
mkdir -p /srv/rabbitmq/data
|
||||
chown 5672:5672 /srv/rabbitmq/data
|
||||
|
||||
# Install service
|
||||
cp ${SOURCE_DIR}/etc/init.d/rabbitmq /etc/init.d/rabbitmq
|
||||
rc-update -u
|
||||
|
@ -1,23 +1,19 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="RabbitMQ docker container"
|
||||
description="RabbitMQ container"
|
||||
|
||||
depend() {
|
||||
need docker
|
||||
need cgroups
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run -d --rm \
|
||||
--name rabbitmq \
|
||||
-h rabbitmq \
|
||||
-v /srv/rabbitmq/data:/var/lib/rabbitmq/mnesia \
|
||||
rabbitmq
|
||||
lxc-start rabbitmq
|
||||
}
|
||||
|
||||
start_post() {
|
||||
timeout -t 60 docker exec rabbitmq sh -c 'until grep -q "Server startup complete" /var/log/rabbitmq/rabbit@rabbitmq.log 2>/dev/null ; do usleep 50000; done'
|
||||
timeout -t 60 sh -c 'until grep -q "Server startup complete" /var/lib/lxc/rabbitmq/delta0/var/log/rabbitmq/rabbit@rabbitmq.log 2>/dev/null; do usleep 50000; done'
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/docker stop rabbitmq
|
||||
lxc-stop rabbitmq
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user