[rabbitmq-discuss] rabbitmqctl.bat not working:Cookie handling problem [windows multi-user access]
watson.timothy at gmail.com
Sun Jan 20 19:33:42 GMT 2013
On 20 Jan 2013, at 15:57, mabra wrote:
> Hello !
> I want to control the shovel status [start/stop/get] and I have to this from my own program,
> which just spawns a sub-process, which uses "rabbitmqctl.bat". It does not work, but this
> is decribed in the trouble shooting document a bit.
> I needed hours to find out the consequence of this statement [from the troubleshooting guide]:
> "Evidence of this comes in the form of a mismatch in the node home dir shown by the broker on startup vs what is displayed in the rabbitmqctl diagnostics."
> is just no help on how to find the cookie, which is in use and how to allow other users
> to use this. In the service-docs is just a small hint:
> "It is therefore necessary to synchronise Erlang cookies
> between the local system account (typically C:\WINDOWS\.erlang.cookie and
> the account that will be used to run rabbitmqctl"
That's hardly a *small* hint - it says that 'it is necessary' to do this. Erlang nodes require a cookie file in order to secure communication with one another. Furthermore, the installation guide for Windows states categorically:
"Erlang Security Cookies used by the service account and the user running rabbitmqctl.bat must be synchronised for rabbitmqctl.bat to function. To ensure Erlang cookie files contain the same string, copy the .erlang.cookie file from the Windows directory (normally C:\WINDOWS\.erlang.cookie) to replace the user .erlang.cookie. The user cookie will be in the user's home directory (%HOMEDRIVE%%HOMEPATH%), e.g. C:\Documents and Settings\%USERNAME%\.erlang.cookie or C:\Users\%USERNAME%\.erlang.cookie (Windows Vista and later)."
Is that not clear enough?
> This leads to the little nightmare to copy the services cookie to all users homedirs,
> which should be able to run "rabbitmqctl.bat". The cookie value is not in the services
> logfile, so, one cannot know it.
Following the Windows installation guide should obviate the need to know what the cookie value is set to.
> So, is ther another way ? This way would require to copy the cookie each time, the
> service is restarted [so, at least on each boot!].
Why would you have to copy the cookie after the service was restarted? Even when running a manually installed Windows Service, you still only need to re-sync the cookies if they have changed. Perhaps I'm missing something? Can't you just copy the cookie to the home directory of the user under which the program always runs? If the cookie is static, can't you just bundle it as an assembly resource and handle it when spawning the sub-process?
> Is there probably a direct accessible
> way from a Net Framework program ?
A 'direct accessible way' of doing what from a .NET program?
More information about the rabbitmq-discuss