rabbitmq-server: chown: unknown user/group @RABBITMQ_USER@:@RABBITMQ_GROUP@
When enabling the management plugin, there is an error that chown can't find the user/group.
# rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@tbrabbit:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@tbrabbit...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
started 3 plugins.
chown: unknown user/group @RABBITMQ_USER@:@RABBITMQ_GROUP@
Apparently, the shell script rabbitmq-plugins
at line 40 is trying to chown the erlang cookie, but the variables for user/group are not set properly:
maybe_fixup_erlang_cookie() {
# rabbitmq/rabbitmq-server-release#85
_rabbitmq_home="$(cd ~rabbitmq && pwd)"
_erlang_cookie="$_rabbitmq_home/.erlang.cookie"
if [ -f "$_erlang_cookie" ]
then
chown @RABBITMQ_USER@:@RABBITMQ_GROUP@ "$_erlang_cookie"
chmod 400 "$_erlang_cookie"
fi
}
A quick grep shows the same variables under the following files:
# grep -ri '@RABBITMQ_USER@' /usr/sbin
/usr/sbin/rabbitmq-server: chown @RABBITMQ_USER@:@RABBITMQ_GROUP@ "$_erlang_cookie"
/usr/sbin/rabbitmq-plugins: chown @RABBITMQ_USER@:@RABBITMQ_GROUP@ "$_erlang_cookie"
/usr/sbin/rabbitmqctl: chown @RABBITMQ_USER@:@RABBITMQ_GROUP@ "$_erlang_cookie"
Thank you.