TL;DR Replace your init script with this one. It uses sudo to change to the RabbitMQ user before starting, stopping, and checking the status.

Here's a link that corroborates what I found:

We're doing an upgrade of RabbitMQ here at Weebly. Moving from a CentOS 5 single node to CentOS 6 with DRBD and Pacemaker. Going from RabbitMQ 2.old-and-busted to How hard could it be? Well a few things.

  • RHEL kinda sorta dropped support for Pacemaker clusters. There's some licensing/you gotta pay for it stuff, going on but I didn't bother reading the whole thing. Luckily, CentOS has the binaries so you're good. One thing to keep in mind is that the cluster-glue libs which RHEL builds are severely hamstrung. In short, change use_logd to no in your corosync file. Otherwise none of the resources will start.
  • The old STONITH agents for Pacemaker are gone in RHEL6. Now you gotta use the fence-agents package and change up your definitions.
  • Serial lines for heartbeat are gone. :(
  • DRBD still isn't in the RHEL kernel, so if you want something recent you still have to build your own.
  • RabbitMQ's init script doesn't work on RHEL/CentOS 6 with sssd enabled. If you run with LDAP, you should be using sssd, so keep that in mind. Use this init script that I threw together, and you're good. Alternatively, you could use daemontools, but I found that RabbitMQ doesn't like responding to UNIX signals properly. I know it's not an Erlang thing since we ran tons of Erlang apps out of daemontools at Mochi Media. Appreciate it if someone could point out what's going on there.
Yay computers or something.

Here's an example of output you'll get with the bad (stock) RabbitMQ init script:

root@rabbit1-a:~# rabbitmq rabbitmqctl status
Status of node rabbit@localhost ...
Error: unable to connect to node rabbit@localhost: nodedown


nodes in question: [rabbit@localhost]

hosts, their running nodes and ports:
- localhost: [{rabbitmqctl8732,17442}]

current node details:
- node name: 'rabbitmqctl8732@rabbit1-a'
- home dir: /var/lib/rabbitmq
- cookie hash: somethingsomething

root@rabbit1-a:~# echo $?

See that exit code of 0? It should be 2. If you do the same thing with sudo -u rabbitmq, it will show an exit code of 2 (which is what you need). That's how I fixed the init script.


11/13/2012 01:34


Thanks very much for this post !

We have also found that sssd causes the su command to return the wrong exit status. We were looking for a fix/workaround and we found this article :)

Do you by any chance know if the sssd people have fixed this issue yet ?

11/13/2012 10:11

Cristian, glad you enjoyed the post. No I haven't found a fix for it yet. I think that I once looked and that it was in the sssd bug database, but it's been so long that I forgot. Maybe I will poke around again this afternoon and see if they have it.

11/14/2012 00:38

We have tested sssd version 1.9.2 ( from here - ) which doesn't have this issue any more. So it seems they have fixed it at some point. Hoping RedHat release an official update for us to use soon.

Soichi Hayashi
11/13/2012 13:19

Hi. Thank you for posting the modified init script. I was having problem starting rabbitmq on RHEL6 and now I can thanks to your script. Have you reported this issue to RabbitMQ maintainer?

11/13/2012 13:56

The problem isn't with RabbitMQ. The problem is with Fedora's sssd software. Not much the RabbitMQ guys should do.

11/17/2012 18:55

Worked for me, thanks!

12/19/2012 01:14

I have a trouble...
I stopped a rabbitmq service, killed epmd, replaced my init script and started service again, but it still starting. Nothing in rabbitmq logs, in secure log I found:
Dec 19 10:03:37 zmonbm101 sudo: root : TTY=pts/1 ; PWD=/usr/sbin ; USER=rabbitmq ; COMMAND=/usr/sbin/rabbitmqctl -n rabbit@localhost status
Dec 19 10:03:37 zmonbm101 runuser: pam_unix(runuser:session): session opened for user rabbitmq by (uid=0)
Dec 19 10:03:37 zmonbm101 sudo: root : TTY=pts/1 ; PWD=/usr/sbin ; USER=rabbitmq ; COMMAND=/usr/sbin/rabbitmqctl wait /var/run/rabbitmq/pid
Dec 19 10:03:37 zmonbm101 runuser: pam_unix(runuser:session): session closed for user rabbitmq

Could you help me, please?

01/08/2013 17:42

I resolved my problem. I read a documentation of rabbotmq and found that there are thresholds configured for memory and disk space. The problem was too small /var partition. Resized it and it work good.

Comments are closed.