fix wily rmq+nrpe lockfile issue bug 1508537
This commit is contained in:
parent
c30fb8d31b
commit
302729399d
@ -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'
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user