diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rabbitmq-mnesia-current | 56 | ||||
| -rwxr-xr-x | scripts/rabbitmq-multi | 18 | ||||
| -rwxr-xr-x[-rw-r--r--] | scripts/rabbitmq-multi.bat | 18 | ||||
| -rwxr-xr-x | scripts/rabbitmq-server | 22 | ||||
| -rwxr-xr-x[-rw-r--r--] | scripts/rabbitmq-server.bat | 20 | ||||
| -rwxr-xr-x | scripts/rabbitmq-service.bat | 195 | ||||
| -rwxr-xr-x | scripts/rabbitmqctl | 25 | ||||
| -rwxr-xr-x[-rw-r--r--] | scripts/rabbitmqctl.bat | 18 |
8 files changed, 326 insertions, 46 deletions
diff --git a/scripts/rabbitmq-mnesia-current b/scripts/rabbitmq-mnesia-current new file mode 100755 index 0000000000..e69e497639 --- /dev/null +++ b/scripts/rabbitmq-mnesia-current @@ -0,0 +1,56 @@ +#!/bin/sh +## The contents of this file are subject to the Mozilla Public License +## Version 1.1 (the "License"); you may not use this file except in +## compliance with the License. You may obtain a copy of the License at +## http://www.mozilla.org/MPL/ +## +## Software distributed under the License is distributed on an "AS IS" +## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +## License for the specific language governing rights and limitations +## under the License. +## +## The Original Code is RabbitMQ. +## +## The Initial Developers of the Original Code are LShift Ltd, +## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +## Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +## Ltd. Portions created by Cohesive Financial Technologies LLC are +## Copyright (C) 2007-2009 Cohesive Financial Technologies +## LLC. Portions created by Rabbit Technologies Ltd are Copyright +## (C) 2007-2009 Rabbit Technologies Ltd. +## +## All Rights Reserved. +## +## Contributor(s): ______________________________________. +## + +[ "x" = "x$NODENAME" ] && NODENAME=rabbit +[ "x" = "x$NODE_IP_ADDRESS" ] && NODE_IP_ADDRESS=0.0.0.0 +[ "x" = "x$NODE_PORT" ] && NODE_PORT=5672 + +CLUSTER_CONFIG_FILE=/etc/default/rabbitmq_cluster.config + +[ "x" = "x$LOG_BASE" ] && LOG_BASE=/var/log/rabbitmq +[ "x" = "x$MNESIA_BASE" ] && MNESIA_BASE=/var/lib/rabbitmq/mnesia +[ "x" = "x$MNESIA_DIR" ] && MNESIA_DIR=${MNESIA_BASE}/${NODENAME} + +if [ -f "$CLUSTER_CONFIG_FILE" ]; then + CLUSTER_CONFIG="-rabbit cluster_config \"$CLUSTER_CONFIG_FILE\"" +else + CLUSTER_CONFIG="" +fi + +exec erl \ + -pa "`dirname $0`/../ebin" \ + -noshell \ + -sname ${NODENAME} \ + -eval 'halt(case rabbit_mnesia:schema_current() of true -> 0; false -> 1 end).' \ + -mnesia dir "\"${MNESIA_DIR}\"" \ + -kernel error_logger '{file,"'/dev/null'"}' \ + ${CLUSTER_CONFIG} diff --git a/scripts/rabbitmq-multi b/scripts/rabbitmq-multi index 5e4f4b3862..8c889a1afa 100755 --- a/scripts/rabbitmq-multi +++ b/scripts/rabbitmq-multi @@ -11,13 +11,19 @@ ## ## The Original Code is RabbitMQ. ## -## The Initial Developers of the Original Code are LShift Ltd., -## Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd. +## The Initial Developers of the Original Code are LShift Ltd, +## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. ## -## Portions created by LShift Ltd., Cohesive Financial Technologies -## LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008 -## LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit -## Technologies Ltd.; +## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +## Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +## Ltd. Portions created by Cohesive Financial Technologies LLC are +## Copyright (C) 2007-2009 Cohesive Financial Technologies +## LLC. Portions created by Rabbit Technologies Ltd are Copyright +## (C) 2007-2009 Rabbit Technologies Ltd. ## ## All Rights Reserved. ## diff --git a/scripts/rabbitmq-multi.bat b/scripts/rabbitmq-multi.bat index 819c99af5c..7899b70db7 100644..100755 --- a/scripts/rabbitmq-multi.bat +++ b/scripts/rabbitmq-multi.bat @@ -11,13 +11,19 @@ REM under the License. REM
REM The Original Code is RabbitMQ.
REM
-REM The Initial Developers of the Original Code are LShift Ltd.,
-REM Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.
+REM The Initial Developers of the Original Code are LShift Ltd,
+REM Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
REM
-REM Portions created by LShift Ltd., Cohesive Financial Technologies
-REM LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008
-REM LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit
-REM Technologies Ltd.;
+REM Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
+REM Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
+REM are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
+REM Technologies LLC, and Rabbit Technologies Ltd.
+REM
+REM Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+REM Ltd. Portions created by Cohesive Financial Technologies LLC are
+REM Copyright (C) 2007-2009 Cohesive Financial Technologies
+REM LLC. Portions created by Rabbit Technologies Ltd are Copyright
+REM (C) 2007-2009 Rabbit Technologies Ltd.
REM
REM All Rights Reserved.
REM
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index c953a75312..f2971cb3d8 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -11,13 +11,19 @@ ## ## The Original Code is RabbitMQ. ## -## The Initial Developers of the Original Code are LShift Ltd., -## Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd. +## The Initial Developers of the Original Code are LShift Ltd, +## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. ## -## Portions created by LShift Ltd., Cohesive Financial Technologies -## LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008 -## LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit -## Technologies Ltd.; +## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +## Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +## Ltd. Portions created by Cohesive Financial Technologies LLC are +## Copyright (C) 2007-2009 Cohesive Financial Technologies +## LLC. Portions created by Rabbit Technologies Ltd are Copyright +## (C) 2007-2009 Rabbit Technologies Ltd. ## ## All Rights Reserved. ## @@ -53,7 +59,7 @@ else CLUSTER_CONFIG="" fi -erl \ +exec erl \ -pa "`dirname $0`/../ebin" \ ${START_RABBIT} \ -sname ${NODENAME} \ @@ -66,7 +72,7 @@ erl \ -sasl sasl_error_logger '{file,"'${SASL_LOGS}'"}' \ -os_mon start_cpu_sup true \ -os_mon start_disksup false \ - -os_mon start_memsup true \ + -os_mon start_memsup false \ -os_mon start_os_sup false \ -os_mon memsup_system_only true \ -os_mon system_memory_high_watermark 0.95 \ diff --git a/scripts/rabbitmq-server.bat b/scripts/rabbitmq-server.bat index 38b8cc5307..41d75f8141 100644..100755 --- a/scripts/rabbitmq-server.bat +++ b/scripts/rabbitmq-server.bat @@ -11,13 +11,19 @@ REM under the License. REM
REM The Original Code is RabbitMQ.
REM
-REM The Initial Developers of the Original Code are LShift Ltd.,
-REM Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.
+REM The Initial Developers of the Original Code are LShift Ltd,
+REM Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
REM
-REM Portions created by LShift Ltd., Cohesive Financial Technologies
-REM LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008
-REM LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit
-REM Technologies Ltd.;
+REM Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
+REM Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
+REM are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
+REM Technologies LLC, and Rabbit Technologies Ltd.
+REM
+REM Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+REM Ltd. Portions created by Cohesive Financial Technologies LLC are
+REM Copyright (C) 2007-2009 Cohesive Financial Technologies
+REM LLC. Portions created by Rabbit Technologies Ltd are Copyright
+REM (C) 2007-2009 Rabbit Technologies Ltd.
REM
REM All Rights Reserved.
REM
@@ -107,7 +113,7 @@ set MNESIA_DIR=%MNESIA_BASE%/%NODENAME%-mnesia -sasl sasl_error_logger {file,\""%LOG_BASE%/%NODENAME%-sasl.log"\"} ^
-os_mon start_cpu_sup true ^
-os_mon start_disksup false ^
--os_mon start_memsup true ^
+-os_mon start_memsup false ^
-os_mon start_os_sup false ^
-os_mon memsup_system_only true ^
-os_mon system_memory_high_watermark 0.95 ^
diff --git a/scripts/rabbitmq-service.bat b/scripts/rabbitmq-service.bat new file mode 100755 index 0000000000..6a1804f3aa --- /dev/null +++ b/scripts/rabbitmq-service.bat @@ -0,0 +1,195 @@ +@echo off
+REM The contents of this file are subject to the Mozilla Public License
+REM Version 1.1 (the "License"); you may not use this file except in
+REM compliance with the License. You may obtain a copy of the License at
+REM http://www.mozilla.org/MPL/
+REM
+REM Software distributed under the License is distributed on an "AS IS"
+REM basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+REM License for the specific language governing rights and limitations
+REM under the License.
+REM
+REM The Original Code is RabbitMQ.
+REM
+REM The Initial Developers of the Original Code are LShift Ltd,
+REM Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
+REM
+REM Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
+REM Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
+REM are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
+REM Technologies LLC, and Rabbit Technologies Ltd.
+REM
+REM Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+REM Ltd. Portions created by Cohesive Financial Technologies LLC are
+REM Copyright (C) 2007-2009 Cohesive Financial Technologies
+REM LLC. Portions created by Rabbit Technologies Ltd are Copyright
+REM (C) 2007-2009 Rabbit Technologies Ltd.
+REM
+REM All Rights Reserved.
+REM
+REM Contributor(s): ______________________________________.
+REM
+
+if "%SERVICENAME%"=="" (
+ set SERVICENAME=RabbitMQ
+)
+
+if "%RABBITMQ_BASE%"=="" (
+ set RABBITMQ_BASE=%APPDATA%\%SERVICENAME%
+)
+
+if "%NODENAME%"=="" (
+ set NODENAME=rabbit
+)
+
+if "%NODE_IP_ADDRESS%"=="" (
+ set NODE_IP_ADDRESS=0.0.0.0
+)
+
+if "%NODE_PORT%"=="" (
+ set NODE_PORT=5672
+)
+
+if "%ERLANG_SERVICE_MANAGER_PATH%"=="" (
+ set ERLANG_SERVICE_MANAGER_PATH=C:\Program Files\erl5.5.5\erts-5.5.5\bin
+)
+
+set CONSOLE_FLAG=
+set CONSOLE_LOG_VALID=
+for %%i in (new reuse) do if "%%i" == "%CONSOLE_LOG%" set CONSOLE_LOG_VALID=TRUE
+if "%CONSOLE_LOG_VALID%" == "TRUE" (
+ set CONSOLE_FLAG=-debugtype %CONSOLE_LOG%
+)
+
+rem *** End of configuration ***
+
+if not exist "%ERLANG_SERVICE_MANAGER_PATH%\erlsrv.exe" (
+ echo.
+ echo **********************************************
+ echo ERLANG_SERVICE_MANAGER_PATH not set correctly.
+ echo **********************************************
+ echo.
+ echo %ERLANG_SERVICE_MANAGER_PATH%\erlsrv.exe not found!
+ echo Please set ERLANG_SERVICE_MANAGER_PATH to the folder containing "erlsrv.exe".
+ echo.
+ exit /B 1
+)
+
+rem erlang prefers forwardslash as separator in paths
+set RABBITMQ_BASE_UNIX=%RABBITMQ_BASE:\=/%
+set MNESIA_BASE=%RABBITMQ_BASE_UNIX%/db
+set LOG_BASE=%RABBITMQ_BASE_UNIX%/log
+
+
+rem We save the previous logs in their respective backup
+rem Log management (rotation, filtering based on size...) is left as an exercise for the user.
+
+set BACKUP_EXTENSION=.1
+
+set LOGS="%RABBITMQ_BASE%\log\%NODENAME%.log"
+set SASL_LOGS="%RABBITMQ_BASE%\log\%NODENAME%-sasl.log"
+
+set LOGS_BACKUP="%RABBITMQ_BASE%\log\%NODENAME%.log%BACKUP_EXTENSION%"
+set SASL_LOGS_BACKUP="%RABBITMQ_BASE%\log\%NODENAME%-sasl.log%BACKUP_EXTENSION%"
+
+if exist %LOGS% (
+ type %LOGS% >> %LOGS_BACKUP%
+)
+if exist %SASL_LOGS% (
+ type %SASL_LOGS% >> %SASL_LOGS_BACKUP%
+)
+
+rem End of log management
+
+
+set CLUSTER_CONFIG_FILE=%RABBITMQ_BASE%\rabbitmq_cluster.config
+set CLUSTER_CONFIG=
+if not exist "%CLUSTER_CONFIG_FILE%" GOTO L1
+set CLUSTER_CONFIG=-rabbit cluster_config \""%CLUSTER_CONFIG_FILE:\=/%"\"
+:L1
+
+set MNESIA_DIR=%MNESIA_BASE%/%NODENAME%-mnesia
+
+
+if "%1" == "install" goto INSTALL_SERVICE
+for %%i in (start stop disable enable list remove) do if "%%i" == "%1" goto MODIFY_SERVICE
+
+echo.
+echo *********************
+echo Service control usage
+echo *********************
+echo.
+echo %~n0 help - Display this help
+echo %~n0 install - Install the %SERVICENAME% service
+echo %~n0 remove - Remove the %SERVICENAME% service
+echo.
+echo The following actions can also be accomplished by using
+echo Windows Services Management Console (services.msc):
+echo.
+echo %~n0 start - Start the %SERVICENAME% service
+echo %~n0 stop - Stop the %SERVICENAME% service
+echo %~n0 disable - Disable the %SERVICENAME% service
+echo %~n0 enable - Enable the %SERVICENAME% service
+echo.
+exit /B
+
+
+:INSTALL_SERVICE
+
+if not exist "%RABBITMQ_BASE%" (
+ echo Creating base directory %RABBITMQ_BASE% & md "%RABBITMQ_BASE%"
+)
+
+"%ERLANG_SERVICE_MANAGER_PATH%\erlsrv" list %SERVICENAME% 2>NUL 1>NUL
+if errorlevel 1 (
+ "%ERLANG_SERVICE_MANAGER_PATH%\erlsrv" add %SERVICENAME%
+) else (
+ echo %SERVICENAME% service is already present - only updating service parameters
+)
+
+set RABBIT_EBIN=%~dp0..\ebin
+
+set ERLANG_SERVICE_ARGUMENTS= ^
+-pa "%RABBIT_EBIN%" ^
+-boot start_sasl ^
+-s rabbit ^
++W w ^
++A30 ^
+-kernel inet_default_listen_options "[{nodelay,true},{sndbuf,16384},{recbuf,4096}]" ^
+-kernel inet_default_connect_options "[{nodelay,true}]" ^
+-rabbit tcp_listeners "[{\"%NODE_IP_ADDRESS%\",%NODE_PORT%}]" ^
+-kernel error_logger {file,\""%LOG_BASE%/%NODENAME%.log"\"} ^
+-sasl errlog_type error ^
+-sasl sasl_error_logger {file,\""%LOG_BASE%/%NODENAME%-sasl.log"\"} ^
+-os_mon start_cpu_sup true ^
+-os_mon start_disksup false ^
+-os_mon start_memsup true ^
+-os_mon start_os_sup false ^
+-os_mon memsup_system_only true ^
+-os_mon system_memory_high_watermark 0.95 ^
+-mnesia dir \""%MNESIA_DIR%"\" ^
+%CLUSTER_CONFIG% ^
+%RABBIT_ARGS% ^
+%*
+
+set ERLANG_SERVICE_ARGUMENTS=%ERLANG_SERVICE_ARGUMENTS:\=\\%
+set ERLANG_SERVICE_ARGUMENTS=%ERLANG_SERVICE_ARGUMENTS:"=\"%
+
+"%ERLANG_SERVICE_MANAGER_PATH%\erlsrv" set %SERVICENAME% ^
+-machine "%ERLANG_SERVICE_MANAGER_PATH%\erl.exe" ^
+-env ERL_CRASH_DUMP="%RABBITMQ_BASE_UNIX%/log" ^
+-workdir "%RABBITMQ_BASE%" ^
+-stopaction "rabbit:stop_and_halt()." ^
+-sname %NODENAME% ^
+%CONSOLE_FLAG% ^
+-args "%ERLANG_SERVICE_ARGUMENTS%" > NUL
+goto END
+
+
+:MODIFY_SERVICE
+
+"%ERLANG_SERVICE_MANAGER_PATH%\erlsrv" %1 %SERVICENAME%
+goto END
+
+
+:END
\ No newline at end of file diff --git a/scripts/rabbitmqctl b/scripts/rabbitmqctl index 419dcf632a..b941b85005 100755 --- a/scripts/rabbitmqctl +++ b/scripts/rabbitmqctl @@ -11,30 +11,29 @@ ## ## The Original Code is RabbitMQ. ## -## The Initial Developers of the Original Code are LShift Ltd., -## Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd. +## The Initial Developers of the Original Code are LShift Ltd, +## Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. ## -## Portions created by LShift Ltd., Cohesive Financial Technologies -## LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008 -## LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit -## Technologies Ltd.; +## Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +## Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +## are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +## Technologies LLC, and Rabbit Technologies Ltd. +## +## Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +## Ltd. Portions created by Cohesive Financial Technologies LLC are +## Copyright (C) 2007-2009 Cohesive Financial Technologies +## LLC. Portions created by Rabbit Technologies Ltd are Copyright +## (C) 2007-2009 Rabbit Technologies Ltd. ## ## All Rights Reserved. ## ## Contributor(s): ______________________________________. ## -[ "x" = "x$NODENAME" ] && NODENAME=rabbit -MNESIA_BASE=/var/lib/rabbitmq/mnesia -LOG_BASE=/var/log/rabbitmq -ERL_ARGS= -MNESIA_DIR=${MNESIA_BASE}/${NODENAME} - exec erl \ -pa "`dirname $0`/../ebin" \ -noinput \ -hidden \ - ${ERL_ARGS} \ -sname rabbitmqctl$$ \ -s rabbit_control \ -extra "$@" diff --git a/scripts/rabbitmqctl.bat b/scripts/rabbitmqctl.bat index 1ee7e825b9..33a10777d0 100644..100755 --- a/scripts/rabbitmqctl.bat +++ b/scripts/rabbitmqctl.bat @@ -11,13 +11,19 @@ REM under the License. REM
REM The Original Code is RabbitMQ.
REM
-REM The Initial Developers of the Original Code are LShift Ltd.,
-REM Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd.
+REM The Initial Developers of the Original Code are LShift Ltd,
+REM Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
REM
-REM Portions created by LShift Ltd., Cohesive Financial Technologies
-REM LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007-2008
-REM LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit
-REM Technologies Ltd.;
+REM Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
+REM Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
+REM are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
+REM Technologies LLC, and Rabbit Technologies Ltd.
+REM
+REM Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
+REM Ltd. Portions created by Cohesive Financial Technologies LLC are
+REM Copyright (C) 2007-2009 Cohesive Financial Technologies
+REM LLC. Portions created by Rabbit Technologies Ltd are Copyright
+REM (C) 2007-2009 Rabbit Technologies Ltd.
REM
REM All Rights Reserved.
REM
|
