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
|
MOUNT /srv/rabbitmq/data var/lib/rabbitmq/mnesia
|
||||||
|
|
||||||
USER 5672 5672
|
USER 5672 5672
|
||||||
|
ENV HOME /usr/lib/rabbitmq
|
||||||
CMD /usr/sbin/rabbitmq-server
|
CMD /usr/sbin/rabbitmq-server
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/rabbitmq
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/setup
|
||||||
|
|
||||||
# Build Docker container
|
|
||||||
docker build -t rabbitmq ${SOURCE_DIR}
|
|
||||||
cp ${SOURCE_DIR}/etc/init.d/rabbitmq /etc/init.d/rabbitmq
|
|
||||||
rc-update -u
|
|
||||||
|
|
||||||
# Create RabbitMQ directory structure
|
# Create RabbitMQ directory structure
|
||||||
mkdir -p /srv/rabbitmq/data
|
mkdir -p /srv/rabbitmq/data
|
||||||
chown 5672:5672 /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
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
description="RabbitMQ docker container"
|
description="RabbitMQ container"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need docker
|
need cgroups
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
/usr/bin/docker run -d --rm \
|
lxc-start rabbitmq
|
||||||
--name rabbitmq \
|
|
||||||
-h rabbitmq \
|
|
||||||
-v /srv/rabbitmq/data:/var/lib/rabbitmq/mnesia \
|
|
||||||
rabbitmq
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start_post() {
|
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() {
|
stop() {
|
||||||
/usr/bin/docker stop rabbitmq
|
lxc-stop rabbitmq
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user