Spotter-VM/rabbitmq/etc/init.d/rabbitmq

24 lines
444 B
Plaintext
Executable File

#!/sbin/openrc-run
description="RabbitMQ docker container"
depend() {
need docker
}
start() {
/usr/bin/docker run -d --rm \
--name rabbitmq \
-h rabbitmq \
-v /srv/rabbitmq/data:/var/lib/rabbitmq/mnesia \
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'
}
stop() {
/usr/bin/docker stop rabbitmq
}