Skip to content

Instantly share code, notes, and snippets.

@tr00st
Created October 11, 2016 11:17
Show Gist options
  • Save tr00st/c4609ca35121253dd0a6b25921c23417 to your computer and use it in GitHub Desktop.
Save tr00st/c4609ca35121253dd0a6b25921c23417 to your computer and use it in GitHub Desktop.
Patch for rabbitmq env file to pull cookie manually
--- rabbitmq-env-orig.bat Tue Oct 11 12:16:01 2016
+++ rabbitmq-env.bat Tue Oct 11 12:10:18 2016
@@ -1,10 +1,12 @@
@echo off
REM Scopes the variables to the current batch file
REM setlocal
+set /p COOKIE_VALUE=<%HOMEDRIVE%%HOMEPATH%\.erlang.cookie
+
rem Preserve values that might contain exclamation marks before
rem enabling delayed expansion
set TDP0=%~dp0
REM setlocal enabledelayedexpansion
@@ -44,11 +46,11 @@
REM echo -n "WARNING: ignoring /etc/rabbitmq/rabbitmq.conf -- "
REM echo "location has moved to ${CONF_ENV_FILE}"
REM fi
REM Common defaults
-set SERVER_ERL_ARGS=+P 1048576 +t 5000000 +stbt !RABBITMQ_SCHEDULER_BIND_TYPE!
+set SERVER_ERL_ARGS=+P 1048576 +t 5000000 +stbt !RABBITMQ_SCHEDULER_BIND_TYPE! -setcookie %COOKIE_VALUE%
REM ## Get configuration variables from the configure environment file
REM [ -f ${CONF_ENV_FILE} ] && . ${CONF_ENV_FILE} || true
if "!RABBITMQ_CONF_ENV_FILE!"=="" (
set RABBITMQ_CONF_ENV_FILE=!CONF_ENV_FILE!
@tr00st
Copy link
Author

tr00st commented Oct 11, 2016

Note: Patch was for RabbitMQ 3.6.5 on Windows 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment