Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10 #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bin/rabbitmq-start
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

# rabbitmq-server is in itself a shell script that doesnt
# use exec (ie, it wont replace init 1 with rabbitmq itself).
# Docker sends its stop signal to the containers init 1, which
# wont reach rabbitmq. This ends up timing out on the Docker-side
# for default 10 seconds, till we (the container) is getting killed.
# We need to trap SIGTERM to handle this.
PID=; trap '[[ ${PID} ]] && /usr/sbin/rabbitmqctl stop; exit 0' SIGTERM SIGINT

ulimit -n 1024
chown -R rabbitmq:rabbitmq /data
exec rabbitmq-server $@
rabbitmq-server $@ & PID=$!

# Dont exit this script since we would loose our SIGTERM trap
wait