-getting rabbitmq pid should now work for all future Ubuntu versions
This commit is contained in:
parent
6166d1d590
commit
7664146519
1 changed files with 4 additions and 3 deletions
|
@ -4,12 +4,13 @@
|
||||||
#done in our rabbitmq init.d script, but placing it here so that monit recognizes
|
#done in our rabbitmq init.d script, but placing it here so that monit recognizes
|
||||||
# it faster (in time for the upcoming airtime-check-system)
|
# it faster (in time for the upcoming airtime-check-system)
|
||||||
codename=`lsb_release -cs`
|
codename=`lsb_release -cs`
|
||||||
if [ "$codename" == "oneiric" ];
|
if [ "$codename" = "lucid" -o "$codename" = "maverick" -o "$codename" = "natty" -o "$codename" = "squeeze" ]
|
||||||
then
|
then
|
||||||
|
rabbitmqpid=`sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids`
|
||||||
|
else
|
||||||
|
#RabbitMQ in Ubuntu Oneiric and newer have a different way of storing the PID.
|
||||||
rabbitmqstatus=`/etc/init.d/rabbitmq-server status | grep "\[{pid"`
|
rabbitmqstatus=`/etc/init.d/rabbitmq-server status | grep "\[{pid"`
|
||||||
rabbitmqpid=`echo $rabbitmqstatus | sed "s/.*,\(.*\)\}.*/\1/"`
|
rabbitmqpid=`echo $rabbitmqstatus | sed "s/.*,\(.*\)\}.*/\1/"`
|
||||||
else
|
|
||||||
rabbitmqpid=`sed "s/.*,\(.*\)\}.*/\1/" /var/lib/rabbitmq/pids`
|
|
||||||
fi
|
fi
|
||||||
echo "RabbitMQ PID: $rabbitmqpid"
|
echo "RabbitMQ PID: $rabbitmqpid"
|
||||||
echo "$rabbitmqpid" > /var/run/rabbitmq.pid
|
echo "$rabbitmqpid" > /var/run/rabbitmq.pid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue