On 25/01/12 19:25, Tom H wrote:
The rabbitmq docs indicate that rabbit would create a pid file as
controlled by the RABBITMQ_PID_FILE environment variable, however on
inspection there is no reason that the init.d/rabbitmq-server script
does that… Presumably something to do with how the service is
started in rabbit-multi mode…?
Any suggestion on how to get rabbit or couchdb to use a pid file, so
they can be monitored by monit?
For rabbit, it looks like the /etc/rc.d/init.d/rabbitmq-server elects
not to create a pid file because the script is using the command for
clustered rabbitmq ie rabbitmq-multi and could potentially have a bunch
of pids to write out.
As the NODE_COUNT is hard coded to 1, its possible to put in some
commands to force a pid file if you need it. Attached is a diff file
adding a couple of lines to the init script shipped with CentOS 5.7 epel
package to add a pid file at the default location.
— /var/cache/systemstate/etc/rc.d/init.d/rabbitmq-server 2011-01-15
+++ /etc/rc.d/init.d/rabbitmq-server 2012-01-25 12:08:44.000000000 -0800
@@ -35,6 +34,8 @@
@@ -45,6 +46,8 @@
[ -n “$LOCK_FILE” ] && touch $LOCK_FILE
“[0-9]+” > pidfile
@@ -67,11 +70,13 @@
if [ $RETVAL = 0 ] ; then
[ -n “$LOCK_FILE” ] && rm -rf $LOCK_FILE