The previous patch was meant to make it clear that an unprivileged user
(other than `rabbitmq`) shouldn't run rabbitmq-plugins.
Unfortunately, it broke the script when called by root, because the
real script was executed as `rabbitmq`. This user doesn't have write
permissions to `/etc/rabbitmq` by default.
Now, rabbitmq-plugins' wrapper must be executed as root and so is the
real script. This should fix the problem described above.
[#149840153]
If the current working directory is not readable, Erlang will crash.
This ensures that we run RabbitMQ scripts from a readable directory.
[#149425921]
Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
The logic is a bit crazy, and the whole purpose of this script is
questionable, but until we get rid of it, we've refactor it to make it
more obvious just how crazy it actually is.
[#149425921]
Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com>
For some reason, the rabbitmq-plugins command could be run
from arbitrary user, which would result in errors unable to
access a cookie file or plugins configuration files.
Changed to work the same way as rabbitmqctl - require root
or rabbitmq user.
[Fixes#149425921]