fix wily rmq+nrpe lockfile issue bug 1508537

This commit is contained in:
Ryan Beisner 2015-10-21 16:21:46 +00:00
parent c30fb8d31b
commit 302729399d
2 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,7 @@ from charmhelpers.contrib.peerstorage import (
from collections import OrderedDict
PACKAGES = ['rabbitmq-server', 'python-amqplib']
PACKAGES = ['rabbitmq-server', 'python-amqplib', 'lockfile-progs']
RABBITMQ_CTL = '/usr/sbin/rabbitmqctl'
COOKIE_PATH = '/var/lib/rabbitmq/.erlang.cookie'

View File

@ -8,6 +8,7 @@ LOCK=/var/lock/rabbitmq-gather-metrics.lock
# Check for a lock file and if not, create one
lockfile-create -r2 --lock-name $LOCK > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to create lockfile: $LOCK."
exit 1
fi
trap "rm -f $LOCK > /dev/null 2>&1" exit