[rabbitmq-discuss] possible bug starting rabbit with NODENAME set?

Dmitriy Samovskiy dmitriy.samovskiy at cohesiveft.com
Thu May 15 17:41:56 BST 2008

rabbitmq-server 1.3.0, Debian Etch, erlang version doesn't seem to matter (R12B-2 and R11B-5)

When NODENAME is set to something other than "rabbit" in /etc/default/rabbitmq, 
`/etc/init.d/rabbitmq start` always fails (while broker is actually started)

My temporary fix is this (startup will take some time to allow the original start to time 

# diff -uN rabbitmq-server-orig rabbitmq-server
--- rabbitmq-server-orig	2008-05-15 11:11:22.000000000 -0500
+++ rabbitmq-server	2008-05-15 11:16:25.000000000 -0500
@@ -28,6 +28,7 @@
  start_rabbitmq () {
        set +e
        su rabbitmq -s /bin/sh -c "$DAEMON start_all ${NODE_COUNT}" > 
/var/log/rabbitmq/startup.log 2> /var/log/rabbitmq/startup.err
+      /usr/sbin/rabbitmqctl -n $NODENAME status >/dev/null 2>&1
        case "$?" in
            echo SUCCESS;;
@@ -42,7 +43,8 @@

  stop_rabbitmq () {
      set +e
-    su rabbitmq -s /bin/sh -c "$DAEMON stop_all" > /var/log/rabbitmq/shutdown.log 2> 
+    #su rabbitmq -s /bin/sh -c "$DAEMON stop_all" > /var/log/rabbitmq/shutdown.log 2> 
+    /usr/sbin/rabbitmqctl -n $NODENAME stop
      if [ $? != 0 ] ; then
          echo FAILED - check /var/log/rabbitmq/shutdown.log, .err
          exit 0

Here are the screen shots:

# cat /etc/default/rabbitmq

# /etc/init.d/rabbitmq-server start
Starting rabbitmq-server: FAILED - check /var/log/rabbitmq/startup.log, .err

# cat /var/log/rabbitmq/startup.*
Starting all nodes...
Starting node 0....
RabbitMQ 1.3.0 (AMQP 8-0)
Copyright (C) 2007-2008 LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit 
Technologies Ltd.
Licensed under the MPL.  See http://www.rabbitmq.com/

Logging to "/var/log/rabbitmq/wabbit.log"
SASL logging to "/var/log/rabbitmq/wabbit-sasl.log"

starting database             ...done
starting core processes       ...done
starting recovery             ...done
starting persister            ...done
starting builtin applications ...done
starting TCP listeners        ...done

broker running

rabbit_multi action start_all failed:

rabbitmq 14717  0.6  0.7  14056  7768 ?        Sl   15:55   0:00 
//usr/lib/erlang/erts-5.5.5/bin/beam -W w -K true -A30 -- -root //usr/lib/erlang -progname 
erl -- -home /var/lib/rabbitmq -pa /usr/sbin/../ebin -noshell -noinput -s rabbit -sname 
wabbit -boot start_sasl -kernel inet_default_listen_options [{sndbuf,16384},{recbuf,4096}] 
-rabbit tcp_listeners [{"", 5672}] -sasl errlog_type error -kernel error_logger 
{file,"/var/log/rabbitmq/wabbit.log"} -sasl sasl_error_logger 
{file,"/var/log/rabbitmq/wabbit-sasl.log"} -os_mon start_cpu_sup true -os_mon 
start_disksup false -os_mon start_memsup false -os_mon start_os_sup false -mnesia dir 
"/var/lib/rabbitmq/mnesia/wabbit" -noshell -noinput

Also, note rabbitmqctl behavior looked erroneous to me (but my expectation might be wrong 
here - I thought when NODENAME was set in /etc/default/rabbitmq, I didn't need to 
explicitly set -n):

# rabbitmqctl status
Status of node rabbit at host1 ...

# rabbitmqctl -n wabbit status
Status of node wabbit at host1 ...
                         {mnesia,"MNESIA  CXC 138 12","4.3.5"},
                         {os_mon,"CPO  CXC 138 46",""},
                         {sasl,"SASL  CXC 138 11",""},
                         {stdlib,"ERTS  CXC 138 10","1.14.5"},
                         {kernel,"ERTS  CXC 138 10","2.11.5"}]},
  {nodes,[wabbit at host1]},
  {running_nodes,[wabbit at host1]}]

More information about the rabbitmq-discuss mailing list