Definable cookie location

451 views
Skip to first unread message

jared

unread,
Oct 30, 2014, 11:29:24 PM10/30/14
to rabbitm...@googlegroups.com
Would it be possible to have the RabbitMQ configuration use an environment variable for it's cookie location and default to the existing locations if a custom path is not defined? 

I have been running two-node clusters with RabbitMQ installed at D:\RabbitMQ. I have the the cookie copied to this directory and are manually setting the cookie vie the erl call in rabbitmq-server and rabbitmqctl scripts as defined on https://www.rabbitmq.com/clustering.html. This just makes upgrading a little messy since I need to update those scripts each time to include the cookie at it's defined path.

Thanks

Michael Klishin

unread,
Oct 31, 2014, 4:23:45 AM10/31/14
to rabbitm...@googlegroups.com, jared
Have you tried HOMEDRIVE or HOMEPATH? See "Synchronise Erlang cookies"
on https://www.rabbitmq.com/install-windows-manual.html.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

jared

unread,
Oct 31, 2014, 2:01:40 PM10/31/14
to rabbitm...@googlegroups.com, ja...@kauppi.la, mic...@rabbitmq.com
I'd rather not modify those variables in case any other processes are utilizing them.

I have tested out the following which would allow the cookie location to be defined via environment variable otherwise to continue to use the defaults as it currently does:

  1. Set environment variable "RABBITMQ_COOKIE", in this case, I have it set to "%RABBITMQ_BASE%\.erlang.cookie".
  2. Modify the scripts to check if it's defined and then pull in the cookie value and define the arguments
    1. if defined RABBITMQ_COOKIE (
          set /p COOKIE=<!RABBITMQ_COOKIE!
          set RABBITMQ_COOKIE_ARGS=-setcookie !COOKIE!
      )
  3. include the arguments on the execution
    • "!ERLANG_HOME!\bin\erl.exe" ^
      !RABBITMQ_COOKIE_ARGS! ^
      -pa "!TDP0!..\ebin" ^

Thoughts?

Simon MacMullen

unread,
Nov 3, 2014, 5:43:16 AM11/3/14
to jared, rabbitm...@googlegroups.com, mic...@rabbitmq.com
On 31/10/14 18:01, jared wrote:
> I have tested out the following which would allow the cookie location to
> be defined via environment variable otherwise to continue to use the
> defaults as it currently does:

If we were talking about Unix I would definitely view this as wrong,
since it allows non-privileged users on the same system to see the
Erlang cookie by inspecting the output of "ps" and thus gain the ability
to run rabbitmqctl.

I think the same problem exists for Windows, although I think culturally
people might be inclined to see it as less of a problem.

I would rather see a solution which changes the HOMEDRIVE or HOMEPATH
just before starting the server / ctl.

We don't have an equivalent of rabbitmq-env.conf on Windows. I wonder if
it's possible to construct one?

Cheers, Simon

Reply all
Reply to author
Forward
0 new messages