diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/rabbitmq-defaults | 2 | ||||
| -rwxr-xr-x | scripts/rabbitmq-env | 2 | ||||
| -rwxr-xr-x | scripts/rabbitmq-plugins | 2 | ||||
| -rwxr-xr-x | scripts/rabbitmq-plugins.bat | 2 | ||||
| -rwxr-xr-x | scripts/rabbitmq-server | 35 | ||||
| -rwxr-xr-x | scripts/rabbitmq-server.bat | 17 | ||||
| -rwxr-xr-x | scripts/rabbitmq-service.bat | 29 | ||||
| -rwxr-xr-x | scripts/rabbitmqctl | 2 | ||||
| -rwxr-xr-x | scripts/rabbitmqctl.bat | 2 |
9 files changed, 72 insertions, 21 deletions
diff --git a/scripts/rabbitmq-defaults b/scripts/rabbitmq-defaults index f4b131cda9..1ab819f6ce 100644 --- a/scripts/rabbitmq-defaults +++ b/scripts/rabbitmq-defaults @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2012-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2012-2014 GoPivotal, Inc. All rights reserved. ## ### next line potentially updated in package install steps diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env index c76e7e4baa..861e0b32f5 100755 --- a/scripts/rabbitmq-env +++ b/scripts/rabbitmq-env @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## # Determine where this script is really located (if this script is diff --git a/scripts/rabbitmq-plugins b/scripts/rabbitmq-plugins index 90eb5a5d77..2ec45be01f 100755 --- a/scripts/rabbitmq-plugins +++ b/scripts/rabbitmq-plugins @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## # Get default settings with user overrides for (RABBITMQ_)<var_name> diff --git a/scripts/rabbitmq-plugins.bat b/scripts/rabbitmq-plugins.bat index 0d1f128ea1..a535ebad31 100755 --- a/scripts/rabbitmq-plugins.bat +++ b/scripts/rabbitmq-plugins.bat @@ -12,7 +12,7 @@ REM REM The Original Code is RabbitMQ.
REM
REM The Initial Developer of the Original Code is GoPivotal, Inc.
-REM Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved.
+REM Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.
REM
setlocal
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 72811adc7b..03cd80e11a 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## # Get default settings with user overrides for (RABBITMQ_)<var_name> @@ -29,6 +29,10 @@ DEFAULT_NODE_PORT=5672 [ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" != "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_IP_ADDRESS=${DEFAULT_NODE_IP_ADDRESS} [ "x" != "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_NODE_PORT=${DEFAULT_NODE_PORT} +[ "x" = "x$RABBITMQ_DIST_PORT" ] && RABBITMQ_DIST_PORT=${DIST_PORT} +[ "x" = "x$RABBITMQ_DIST_PORT" ] && [ "x" = "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_DIST_PORT=$((${DEFAULT_NODE_PORT} + 20000)) +[ "x" = "x$RABBITMQ_DIST_PORT" ] && [ "x" != "x$RABBITMQ_NODE_PORT" ] && RABBITMQ_DIST_PORT=$((${RABBITMQ_NODE_PORT} + 20000)) + [ "x" = "x$RABBITMQ_NODENAME" ] && RABBITMQ_NODENAME=${NODENAME} [ "x" = "x$RABBITMQ_SERVER_ERL_ARGS" ] && RABBITMQ_SERVER_ERL_ARGS=${SERVER_ERL_ARGS} [ "x" = "x$RABBITMQ_CONFIG_FILE" ] && RABBITMQ_CONFIG_FILE=${CONFIG_FILE} @@ -81,18 +85,24 @@ case "$(uname -s)" in fi esac -export RABBITMQ_CONFIG_FILE - RABBITMQ_EBIN_ROOT="${RABBITMQ_HOME}/ebin" -if ! ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \ - -boot "${CLEAN_BOOT_FILE}" \ - -noinput \ - -hidden \ - -s rabbit_prelaunch \ - -sname rabbitmqprelaunch$$ \ - -extra "${RABBITMQ_NODENAME}"; - then - exit 1; + +RABBITMQ_CONFIG_FILE=$RABBITMQ_CONFIG_FILE \ +RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \ + ${ERL_DIR}erl -pa "$RABBITMQ_EBIN_ROOT" \ + -boot "${CLEAN_BOOT_FILE}" \ + -noinput \ + -hidden \ + -s rabbit_prelaunch \ + -sname rabbitmqprelaunch$$ \ + -extra "${RABBITMQ_NODENAME}" + +PRELAUNCH_RESULT=$? +if [ ${PRELAUNCH_RESULT} = 1 ] ; then + exit 1 +elif [ ${PRELAUNCH_RESULT} = 0 ] ; then + # dist port is not mentioned in the config file, we can set it + RABBITMQ_DIST_ARG="-kernel inet_dist_listen_min ${RABBITMQ_DIST_PORT} -kernel inet_dist_listen_max ${RABBITMQ_DIST_PORT}" fi RABBITMQ_CONFIG_ARG= @@ -127,4 +137,5 @@ exec ${ERL_DIR}erl \ -os_mon start_memsup false \ -mnesia dir "\"${RABBITMQ_MNESIA_DIR}\"" \ ${RABBITMQ_SERVER_START_ARGS} \ + ${RABBITMQ_DIST_ARG} \ "$@" diff --git a/scripts/rabbitmq-server.bat b/scripts/rabbitmq-server.bat index b00821eda7..043204faaa 100755 --- a/scripts/rabbitmq-server.bat +++ b/scripts/rabbitmq-server.bat @@ -12,7 +12,7 @@ REM REM The Original Code is RabbitMQ.
REM
REM The Initial Developer of the Original Code is GoPivotal, Inc.
-REM Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved.
+REM Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.
REM
setlocal
@@ -45,6 +45,14 @@ if "!RABBITMQ_NODE_IP_ADDRESS!"=="" ( )
)
+if "!RABBITMQ_DIST_PORT!"=="" (
+ if "!RABBITMQ_NODE_PORT!"=="" (
+ set RABBITMQ_DIST_PORT=25672
+ ) else (
+ set /a RABBITMQ_DIST_PORT=20000+!RABBITMQ_NODE_PORT!
+ )
+)
+
if not exist "!ERLANG_HOME!\bin\erl.exe" (
echo.
echo ******************************
@@ -99,8 +107,12 @@ set RABBITMQ_EBIN_ROOT=!TDP0!..\ebin -sname rabbitmqprelaunch!RANDOM!!TIME:~9! ^
-extra "!RABBITMQ_NODENAME!"
-if ERRORLEVEL 1 (
+if ERRORLEVEL 2 (
+ rem dist port mentioned in config, do not attempt to set it
+) else if ERRORLEVEL 1 (
exit /B 1
+) else (
+ set RABBITMQ_DIST_ARG=-kernel inet_dist_listen_min !RABBITMQ_DIST_PORT! -kernel inet_dist_listen_max !RABBITMQ_DIST_PORT!
)
set RABBITMQ_EBIN_PATH="-pa !RABBITMQ_EBIN_ROOT!"
@@ -147,6 +159,7 @@ if not "!RABBITMQ_NODE_IP_ADDRESS!"=="" ( -os_mon start_memsup false ^
-mnesia dir \""!RABBITMQ_MNESIA_DIR:\=/!"\" ^
!RABBITMQ_SERVER_START_ARGS! ^
+!RABBITMQ_DIST_ARG! ^
!STAR!
endlocal
diff --git a/scripts/rabbitmq-service.bat b/scripts/rabbitmq-service.bat index 8c350f7aad..7040209753 100755 --- a/scripts/rabbitmq-service.bat +++ b/scripts/rabbitmq-service.bat @@ -12,7 +12,7 @@ REM REM The Original Code is RabbitMQ.
REM
REM The Initial Developer of the Original Code is GoPivotal, Inc.
-REM Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved.
+REM Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.
REM
setlocal
@@ -59,6 +59,14 @@ if "!RABBITMQ_NODE_IP_ADDRESS!"=="" ( )
)
+if "!RABBITMQ_DIST_PORT!"=="" (
+ if "!RABBITMQ_NODE_PORT!"=="" (
+ set RABBITMQ_DIST_PORT=25672
+ ) else (
+ set /a RABBITMQ_DIST_PORT=20000+!RABBITMQ_NODE_PORT!
+ )
+)
+
if "!ERLANG_SERVICE_MANAGER_PATH!"=="" (
if not exist "!ERLANG_HOME!\bin\erl.exe" (
echo.
@@ -172,6 +180,24 @@ if "!RABBITMQ_CONFIG_FILE!"=="" ( set RABBITMQ_CONFIG_FILE=!RABBITMQ_BASE!\rabbitmq
)
+"!ERLANG_HOME!\bin\erl.exe" ^
+ -pa "!RABBITMQ_EBIN_ROOT!" ^
+ -noinput -hidden ^
+ -s rabbit_prelaunch ^
+ -sname rabbitmqprelaunch!RANDOM!!TIME:~9!
+
+if ERRORLEVEL 3 (
+ rem ERRORLEVEL means (or greater) so we need to catch all other failure
+ rem cases here
+ exit /B 1
+) else if ERRORLEVEL 2 (
+ rem dist port mentioned in config, do not attempt to set it
+) else if ERRORLEVEL 1 (
+ exit /B 1
+) else (
+ set RABBITMQ_DIST_ARG=-kernel inet_dist_listen_min !RABBITMQ_DIST_PORT! -kernel inet_dist_listen_max !RABBITMQ_DIST_PORT!
+)
+
if exist "!RABBITMQ_CONFIG_FILE!.config" (
set RABBITMQ_CONFIG_ARG=-config "!RABBITMQ_CONFIG_FILE!"
) else (
@@ -208,6 +234,7 @@ set ERLANG_SERVICE_ARGUMENTS= ^ -os_mon start_memsup false ^
-mnesia dir \""!RABBITMQ_MNESIA_DIR:\=/!"\" ^
!RABBITMQ_SERVER_START_ARGS! ^
+!RABBITMQ_DIST_ARG! ^
!STARVAR!
set ERLANG_SERVICE_ARGUMENTS=!ERLANG_SERVICE_ARGUMENTS:\=\\!
diff --git a/scripts/rabbitmqctl b/scripts/rabbitmqctl index d0f22ce6b0..ff9cb7fa50 100755 --- a/scripts/rabbitmqctl +++ b/scripts/rabbitmqctl @@ -12,7 +12,7 @@ ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. -## Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved. +## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## # Get default settings with user overrides for (RABBITMQ_)<var_name> diff --git a/scripts/rabbitmqctl.bat b/scripts/rabbitmqctl.bat index d7cbbb102c..8e8ba1bd71 100755 --- a/scripts/rabbitmqctl.bat +++ b/scripts/rabbitmqctl.bat @@ -12,7 +12,7 @@ REM REM The Original Code is RabbitMQ.
REM
REM The Initial Developer of the Original Code is GoPivotal, Inc.
-REM Copyright (c) 2007-2013 GoPivotal, Inc. All rights reserved.
+REM Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.
REM
setlocal
|
