|
| 1 | +@echo off |
| 2 | +REM The contents of this file are subject to the Mozilla Public License |
| 3 | +REM Version 1.1 (the "License"); you may not use this file except in |
| 4 | +REM compliance with the License. You may obtain a copy of the License |
| 5 | +REM at http://www.mozilla.org/MPL/ |
| 6 | +REM |
| 7 | +REM Software distributed under the License is distributed on an "AS IS" |
| 8 | +REM basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See |
| 9 | +REM the License for the specific language governing rights and |
| 10 | +REM limitations under the License. |
| 11 | +REM |
| 12 | +REM The Original Code is RabbitMQ. |
| 13 | +REM |
| 14 | +REM The Initial Developer of the Original Code is GoPivotal, Inc. |
| 15 | +REM Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. |
| 16 | +REM |
| 17 | + |
| 18 | +REM Scopes the variables to the current batch file |
| 19 | +setlocal |
| 20 | + |
| 21 | +rem Preserve values that might contain exclamation marks before |
| 22 | +rem enabling delayed expansion |
| 23 | +set TDP0=%~dp0 |
| 24 | +set STAR=%* |
| 25 | +setlocal enabledelayedexpansion |
| 26 | + |
| 27 | +REM Get default settings with user overrides for (RABBITMQ_)<var_name> |
| 28 | +REM Non-empty defaults should be set in rabbitmq-env |
| 29 | +call "%TDP0%\rabbitmq-env.bat" %~n0 |
| 30 | + |
| 31 | +if not exist "!ERLANG_HOME!\bin\erl.exe" ( |
| 32 | + echo. |
| 33 | + echo ****************************** |
| 34 | + echo ERLANG_HOME not set correctly. |
| 35 | + echo ****************************** |
| 36 | + echo. |
| 37 | + echo Please either set ERLANG_HOME to point to your Erlang installation or place the |
| 38 | + echo RabbitMQ server distribution in the Erlang lib folder. |
| 39 | + echo. |
| 40 | + exit /B 1 |
| 41 | +) |
| 42 | + |
| 43 | +REM Disable erl_crash.dump by default for control scripts. |
| 44 | +if not defined ERL_CRASH_DUMP_SECONDS ( |
| 45 | + set ERL_CRASH_DUMP_SECONDS=0 |
| 46 | +) |
| 47 | + |
| 48 | +"!ERLANG_HOME!\bin\erl.exe" +B ^ |
| 49 | +-boot !CLEAN_BOOT_FILE! ^ |
| 50 | +-noinput -noshell -hidden -smp enable ^ |
| 51 | +!RABBITMQ_CTL_ERL_ARGS! ^ |
| 52 | +-kernel inet_dist_listen_min !RABBITMQ_CTL_DIST_PORT_MIN! ^ |
| 53 | +-kernel inet_dist_listen_max !RABBITMQ_CTL_DIST_PORT_MAX! ^ |
| 54 | +-sasl errlog_type error ^ |
| 55 | +-mnesia dir \""!RABBITMQ_MNESIA_DIR:\=/!"\" ^ |
| 56 | +-nodename !RABBITMQ_NODENAME! ^ |
| 57 | +-run escript start ^ |
| 58 | +-escript main rabbitmqctl_escript ^ |
| 59 | +-extra "%RABBITMQ_HOME%\escript\rabbitmq-queues" !STAR! |
| 60 | + |
| 61 | +if ERRORLEVEL 1 ( |
| 62 | + exit /B 1 |
| 63 | +) |
| 64 | + |
| 65 | +endlocal |
| 66 | +endlocal |
0 commit comments