summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-13 17:10:56 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-13 17:10:56 +0000
commit7ba780d84aae4dfb8b88ff997ca100512b8025fc (patch)
tree5db40260ac49206ce2b81eee5e7e63a7ef489d8d /scripts
parent8cc1b2be40b52617a36804c41c98a313f4e3c6dc (diff)
downloadrabbitmq-server-git-7ba780d84aae4dfb8b88ff997ca100512b8025fc.tar.gz
Check the config situation when installing the Windows service.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rabbitmq-service.bat27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/rabbitmq-service.bat b/scripts/rabbitmq-service.bat
index 8c350f7aad..28ee7d3054 100755
--- a/scripts/rabbitmq-service.bat
+++ b/scripts/rabbitmq-service.bat
@@ -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.
@@ -168,6 +176,24 @@ if "!RABBITMQ_PLUGINS_DIR!"=="" (
set RABBITMQ_EBIN_ROOT=!TDP0!..\ebin
+"!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 "!RABBITMQ_CONFIG_FILE!"=="" (
set RABBITMQ_CONFIG_FILE=!RABBITMQ_BASE!\rabbitmq
)
@@ -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:\=\\!