RABBITMQ_ENABLED_PLUGINS_FILE appears to be ignored when plugin is enabled

1,760 views
Skip to first unread message

Ben Dalby

unread,
Nov 25, 2014, 5:32:14 AM11/25/14
to rabbitm...@googlegroups.com
Hi there,

I'm trying to change the location that Rabbit reads its enabled plugins file from (/etc/rabbitmq is not writable in the target environment)

Here's what I did:
1. Stopped running Rabbit:
rabbitmqctl stop

2. Added RABBITMQ_ENABLED_PLUGINS_FILE in shell script that starts Rabbit:
export RABBITMQ_ENABLED_PLUGINS_FILE=/PATH/TO/NEW_DIRECTORY/rabbit_conf/enabled_plugins

3. Restarted Rabbit from that shell script with 
rabbitmq_server -detached

4. Verified my environment variable is being picked up both with "rabbitmqctl environment" and with "ps aux | grep rabbit" (output below - actual host name and directory edited out by me, but you get the idea)

rabbitmq 59559  4.7  0.0 2453080 43540 ?       Sl   09:51   1:22 /usr/lib64/erlang/erts-5.9.2/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.3.0/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@HOSTNAME -boot start_sasl -config /etc/rabbitmq/rabbitmq -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file,"/var/log/rabbitmq/rab...@HOSTNAME.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rab...@HOSTNAME-sasl.log"} -rabbit enabled_plugins_file "/PATH/TO/NEW_DIRECTORY/rabbit_conf/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.3.0/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@HOSTNAME-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/var/lib/rabbitmq/mnesia/rabbit@HOSTNAME" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672 -noshell -noinput

When I try and enable a sample plugin, I get the following error:
$ rabbitmq-plugins enable rabbitmq_stomp
Error: {cannot_write_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
           eacces}

Do I need to do something more to make Rabbit 'forget' the default enabled_plugins_file location?

Best wishes

Ben

Michael Klishin

unread,
Nov 25, 2014, 5:35:00 AM11/25/14
to Ben Dalby, rabbitm...@googlegroups.com
On 25 November 2014 at 13:32:15, Ben Dalby (bda...@pivotal.io) wrote:
> 2. Added RABBITMQ_ENABLED_PLUGINS_FILE in shell script that
> starts Rabbit:
> export RABBITMQ_ENABLED_PLUGINS_FILE=/PATH/TO/NEW_DIRECTORY/rabbit_conf/enabled_plugins



> When I try and enable a sample plugin, I get the following error:
> $ rabbitmq-plugins enable rabbitmq_stomp
> Error: {cannot_write_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
> eacces}
>
>
> Do I need to do something more to make Rabbit 'forget' the default
> enabled_plugins_file location?

Exports are user- and session-specific, so the env variable may or may not be actually
in effect for rabbitmq-server . It is highly recommended to use
rabbitmq-env.conf:

http://www.rabbitmq.com/configure.html
http://www.rabbitmq.com/man/rabbitmq-env.conf.5.man.html
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Simon MacMullen

unread,
Nov 25, 2014, 6:08:26 AM11/25/14
to Michael Klishin, Ben Dalby, rabbitm...@googlegroups.com
On 25/11/14 10:34, Michael Klishin wrote:
> Exports are user- and session-specific, so the env variable may or may not be actually
> in effect for rabbitmq-server

It is in effect for the server, the ps output showed that.

However, it is probably not in effect for rabbitmq-plugins. Both
rabbitmq-plugins and rabbitmq-server read that env variable.

Cheers, Simon

Ben Dalby

unread,
Nov 25, 2014, 6:31:24 AM11/25/14
to rabbitm...@googlegroups.com, mkli...@pivotal.io, bda...@pivotal.io
Hi Michael

My understanding is that rabbitmq-env.conf *has* to be in /etc/rabbitmq/ - I can't write to that location, unfortunately.

Hi Simon,

You hit the nail on the head there. When I called rabbitmq-plugins from a shell script that also set the relevant environment variable, it worked fine.

Clearly one has to be careful here - a subsequent call to "rabbitmq-plugins list" which neglects the environment variable will still show the data from /etc/rabbitmq/enabled_plugins, even though rabbitmqctl status now shows the plugin I was working on to be enabled.

Thanks both,

Best wishes

Ben

Hi Simon,
Reply all
Reply to author
Forward
0 new messages