2

When attempting to use rabbitmqctl, I get the following error:

$ which rabbitmqctl
/usr/sbin/rabbitmqctl
$ sudo rabbitmqctl status
/usr/lib/rabbitmq/bin/rabbitmqctl: line 29: exec: erl: not found

(/usr/sbin/rabbitmqctl most likely invokes /usr/lib/rabbitmq/bin/rabbitmqctl in its source: /usr/lib/rabbitmq/bin/${SCRIPT} - guessing ${SCRIPT} evaluates to rabbitmqctl)

However, when simply accessing erl from the shell, I reach the erlang shell as expected

$ which erl
/usr/local/bin/erl
$ ls -la /usr/local/bin/erl
lrwxrwxrwx 1 root root 21 Jul 18 02:03 /usr/local/bin/erl -> ../lib/erlang/bin/erl
$ erl
Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:16:16] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.9.1  (abort with ^G)
1>

Setup information:

  • CentOS 6.2
  • Erlang R15B01 compiled from otp_src_R15B01.tar.gz
  • RabbitMQ 2.8.4 installed from rabbitmq-server-2.8.4-1.noarch.rpm. Default configuration (no conf files).

Path:

$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/myuser/bin

After looking in the source of rabbitmqctl, it seems this is just a simple invocation to erl, no magic involved:

exec erl \
    -pa "${RABBITMQ_HOME}/ebin" \
    -noinput \
    -hidden \
    ${RABBITMQ_CTL_ERL_ARGS} \
    -sname rabbitmqctl$$ \
    -s rabbit_control \
    -nodename $RABBITMQ_NODENAME \
    -extra "$@"

Can't seem to figure out what the problem really is...

womble
  • 96,255
  • 29
  • 175
  • 230
scooz
  • 233
  • 1
  • 3
  • 8

1 Answers1

6

As expected, it was a PATH problem:

$ sudo which erl
which: no erl in (/sbin:/bin:/usr/sbin:/usr/bin)

Resolved this by creating a symlink for erl:

sudo ln -s /usr/local/bin/erl /usr/bin/erl

Maybe a symlink to /usr/bin can be avoided somehow (/usr/local/... or something).

scooz
  • 233
  • 1
  • 3
  • 8
  • Thanks to the guys at #rabbitmq (freenode) for helping me out. – scooz Jul 18 '12 at 11:07
  • It looks like you installed Erlang by yourself. There's actually an Erlang 4.1 rpm in the EPEL repository for CentOS6. It would likely be better if you used that, unless RabbitMQ had specific version requirements. In general, you should prefer package installations over compile-it-yourself, unless you have specific reasons not to use the package. – cjc Jul 18 '12 at 11:10
  • 1
    Actually, you should NEVER prefer package installations over compile it yourself for tools which are core to your business. The upstream versions are always much more up to date, and if they do not distribute an RPM or DEB version, then build it yourself is better. In particular RabbitMQ has made great advances in the last couple of years and all Linux distros have lagged far behind because they don't consider RabbitMQ to be that important. – Michael Dillon Jul 23 '12 at 02:01
  • I didn't even have erl in `/usr/local/bin`, but found it in `/usr/local/lib/erlang/bin/` – EdgeCaseBerg Jun 09 '14 at 16:53