summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-11-25 18:14:26 +0000
committerMatthew Sackman <matthew@lshift.net>2009-11-25 18:14:26 +0000
commitbeae0e9fba54b3a7cd07d8f66c4b3e1fe663ea3d (patch)
tree13d3fc110cc8897fa8f3461bf830e0b82120d8c1 /scripts
parent583b1441fdc758d5c7a71c39a5baf74ed81a4f3d (diff)
downloadrabbitmq-server-beae0e9fba54b3a7cd07d8f66c4b3e1fe663ea3d.tar.gz
multi is a convenience. It should blow up when starting > 1 nodes when we have multiple tcp listeners. When starting > 1 nodes, make sure we export the discovered node ip address and port. When starting just 1 node, don't export anything - either rabbit-server will rediscover it in the env, or it's all configured in the config file.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rabbitmq-multi9
-rwxr-xr-xscripts/rabbitmq-multi.bat13
-rwxr-xr-xscripts/rabbitmq-server3
-rwxr-xr-xscripts/rabbitmq-server.bat6
4 files changed, 24 insertions, 7 deletions
diff --git a/scripts/rabbitmq-multi b/scripts/rabbitmq-multi
index d8b0f074..1a7eb97e 100755
--- a/scripts/rabbitmq-multi
+++ b/scripts/rabbitmq-multi
@@ -36,6 +36,7 @@ SCRIPT_HOME=$(dirname $0)
PIDS_FILE=/var/lib/rabbitmq/pids
MULTI_ERL_ARGS=
MULTI_START_ARGS=
+CONFIG_FILE=/etc/rabbitmq/rabbitmq
. `dirname $0`/rabbitmq-env
@@ -54,13 +55,18 @@ fi
[ "x" = "x$RABBITMQ_PIDS_FILE" ] && RABBITMQ_PIDS_FILE=${PIDS_FILE}
[ "x" = "x$RABBITMQ_MULTI_ERL_ARGS" ] && RABBITMQ_MULTI_ERL_ARGS=${MULTI_ERL_ARGS}
[ "x" = "x$RABBITMQ_MULTI_START_ARGS" ] && RABBITMQ_MULTI_START_ARGS=${MULTI_START_ARGS}
+[ "x" = "x$RABBITMQ_CONFIG_FILE" ] && RABBITMQ_CONFIG_FILE=${CONFIG_FILE}
export \
RABBITMQ_NODENAME \
RABBITMQ_NODE_IP_ADDRESS \
RABBITMQ_NODE_PORT \
RABBITMQ_SCRIPT_HOME \
- RABBITMQ_PIDS_FILE
+ RABBITMQ_PIDS_FILE \
+ RABBITMQ_CONFIG_FILE
+
+RABBITMQ_CONFIG_ARG=
+[ -f "${RABBITMQ_CONFIG_FILE}.config" ] && RABBITMQ_CONFIG_ARG="-config ${RABBITMQ_CONFIG_FILE}"
# we need to turn off path expansion because some of the vars, notably
# RABBITMQ_MULTI_ERL_ARGS, may contain terms that look like globs and
@@ -73,6 +79,7 @@ exec erl \
-hidden \
${RABBITMQ_MULTI_ERL_ARGS} \
-sname rabbitmq_multi$$ \
+ ${RABBITMQ_CONFIG_ARG} \
-s rabbit_multi \
${RABBITMQ_MULTI_START_ARGS} \
-extra "$@"
diff --git a/scripts/rabbitmq-multi.bat b/scripts/rabbitmq-multi.bat
index 9f134f17..6dda13af 100755
--- a/scripts/rabbitmq-multi.bat
+++ b/scripts/rabbitmq-multi.bat
@@ -53,10 +53,20 @@ if "%RABBITMQ_NODE_IP_ADDRESS%"=="" (
set RABBITMQ_PIDS_FILE=%RABBITMQ_BASE%\rabbitmq.pids
set RABBITMQ_SCRIPT_HOME=%~sdp0%
+if "%RABBITMQ_CONFIG_FILE%"=="" (
+ set RABBITMQ_CONFIG_FILE=%RABBITMQ_BASE%\rabbitmq
+)
+
+if exist "%RABBITMQ_CONFIG_FILE%.config" (
+ set RABBITMQ_CONFIG_ARG=-config "%RABBITMQ_CONFIG_FILE%"
+) else (
+ set RABBITMQ_CONFIG_ARG=
+)
+
if not exist "%ERLANG_HOME%\bin\erl.exe" (
echo.
echo ******************************
- echo ERLANG_HOME not set correctly.
+ echo ERLANG_HOME not set correctly.
echo ******************************
echo.
echo Please either set ERLANG_HOME to point to your Erlang installation or place the
@@ -70,6 +80,7 @@ if not exist "%ERLANG_HOME%\bin\erl.exe" (
-noinput -hidden ^
%RABBITMQ_MULTI_ERL_ARGS% ^
-sname rabbitmq_multi ^
+%RABBITMQ_CONFIG_ARG% ^
-s rabbit_multi ^
%RABBITMQ_MULTI_START_ARGS% ^
-extra %*
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server
index 8ba7d6b8..7f08cd9d 100755
--- a/scripts/rabbitmq-server
+++ b/scripts/rabbitmq-server
@@ -44,7 +44,6 @@ SERVER_START_ARGS=
. `dirname $0`/rabbitmq-env
-
if [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ]
then
if [ "x" != "x$RABBITMQ_NODE_PORT" ]
@@ -99,7 +98,7 @@ RABBITMQ_CONFIG_ARG=
[ -f "${RABBITMQ_CONFIG_FILE}.config" ] && RABBITMQ_CONFIG_ARG="-config ${RABBITMQ_CONFIG_FILE}"
RABBITMQ_LISTEN_ARG=
-[ "x" != "x$RABBITMQ_NODE_PORT" ] && [ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_LISTEN_ARG="-rabbit tcp_listeners '[{"'${RABBITMQ_NODE_IP_ADDRESS}'", '${RABBITMQ_NODE_PORT}'}]'"
+[ "x" != "x$RABBITMQ_NODE_PORT" ] && [ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && RABBITMQ_LISTEN_ARG="-rabbit tcp_listeners [{\""${RABBITMQ_NODE_IP_ADDRESS}"\","${RABBITMQ_NODE_PORT}"}]"
# we need to turn off path expansion because some of the vars, notably
# RABBITMQ_SERVER_ERL_ARGS, contain terms that look like globs and
diff --git a/scripts/rabbitmq-server.bat b/scripts/rabbitmq-server.bat
index 42ed185f..51102851 100755
--- a/scripts/rabbitmq-server.bat
+++ b/scripts/rabbitmq-server.bat
@@ -53,7 +53,7 @@ if "%RABBITMQ_NODE_IP_ADDRESS%"=="" (
if not exist "%ERLANG_HOME%\bin\erl.exe" (
echo.
echo ******************************
- echo ERLANG_HOME not set correctly.
+ echo ERLANG_HOME not set correctly.
echo ******************************
echo.
echo Please either set ERLANG_HOME to point to your Erlang installation or place the
@@ -116,7 +116,7 @@ if exist "%RABBITMQ_EBIN_ROOT%\rabbit.boot" (
if "%RABBITMQ_CONFIG_FILE%"=="" (
set RABBITMQ_CONFIG_FILE=%RABBITMQ_BASE%\rabbitmq
)
-
+
if exist "%RABBITMQ_CONFIG_FILE%.config" (
set RABBITMQ_CONFIG_ARG=-config "%RABBITMQ_CONFIG_FILE%"
) else (
@@ -126,7 +126,7 @@ if exist "%RABBITMQ_CONFIG_FILE%.config" (
set RABBITMQ_LISTEN_ARG=
if not "%RABBITMQ_NODE_IP_ADDRESS%"=="" (
if not "%RABBITMQ_NODE_PORT%"=="" (
- set RABBITMQ_LISTEN_ARG=-rabbit tcp_listeners "[{\"%RABBITMQ_NODE_IP_ADDRESS%\", %RABBITMQ_NODE_PORT%}]"
+ set RABBITMQ_LISTEN_ARG=-rabbit tcp_listeners [{\""%RABBITMQ_NODE_IP_ADDRESS%"\","%RABBITMQ_NODE_PORT%"}]
)
)