[rabbitmq-discuss] Error running rabbitmqctl

David Wragg david at rabbitmq.com
Fri Jun 25 01:33:40 BST 2010

Hi Russell,

Russell Borogove <russell at borogove.org> writes:
> On Jun 24, 2010, at 9:57 AM, David Wragg wrote:
>>> So I repeat my question -- does rabbit expect [MACPORTS_PREFIX]?
>> Rabbit does not look at MACPORTS_PREFIX.  As with other macports ports,
>> the rabbitmq-server portfile takes its prefix from the macports config.
> I was asking more about the runtime cookie-seeking behavior.

Rabbit never looks at MACPORTS_PREFIX for any reason.

> My guess is the root of the problem here is that the environment,
> specifically $HOME, isn't changed when a regular user is interactively
> running 'sudo rabbitmq-server' per
> http://www.rabbitmq.com/install.html#running-macports. $HOME remains
> ~russell, so that's where the cookie is found:

Sounds plausible.

> russell at shard ~: sudo su -m rabbitmq -c "echo $HOME"
> /Users/russell

Note that, because of the double quotes, $HOME will be substituted by
your shell running as your normal user, therefore it will always reflect
your normal home directory.  You want single quotes.

I think your point is that the su line in the wrapper script used by
rabbitmqctl, rabbitmq-server, etc., as reproduced in your command above,
does not set $HOME, but due to the cookie issue, it should?

I would expect the following command to yield /Users/rabbitmq for you:

$ sudo su rabbitmq -c 'echo $HOME'

If so, the fix might just be to remove the -m option.  Right now, I
don't grasp why that option was inclued in the wrapper script.

I'll file a bug for this as soon as I've reproduced your problem.
Testing rabbitmq-server on macports is a big awkward at the moment due
to the premature inclusion of erlang R14A, so this might take a few


David Wragg
Staff Engineer, RabbitMQ
SpringSource, a division of VMware

More information about the rabbitmq-discuss mailing list