[rabbitmq-discuss] /var/lib/rabbitmq/pids

Ronen narkisr at gmail.com
Tue Jul 5 15:51:40 BST 2011


Ok this is how iv solved this, iv patched the rabbitmq-server init
file and added the following:

The following are added to the start function:

  pid=`/usr/sbin/rabbitmqctl status | perl -n -e'/{pid,(\d+)/ && print
$1'`
  echo $pid > /var/run/rabbitmq.pid

Right before:

  echo SUCCESS

The pid file is deleted within the stop function:

         rm /var/run/rabbitmq.pid

right after,

         if [ $RETVAL = 0 ] ; then

Thanks David and Matthew
Ronen


On Jul 5, 4:46 pm, David Wragg <da... at rabbitmq.com> wrote:
> Ronen <nark... at gmail.com> writes:
> > David did you mean to use:
>
> > "setsid sh -c 'echo $$ >$PIDFILE ; exec rabbitmq-server </dev/null >
> > $RABBITMQ_LOG_BASE/rabbitmq_startup_log 2>&1' &
> >     rabbitmqctl wait >/dev/null 2>&1"
>
> > As the monit command entry or to use it within the init file itself?
>
> You'll need to incorporate that into a script that monit runs.  It
> should be easy to incorporate into the rabbitmq-server init script,
> which already contains commands very like those.
>
> --
> David Wragg
> Staff Engineer, RabbitMQ
> VMware, Inc.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list