wily: collect_rabbitmq_stats.sh can't create lockfile

Bug #1508537 reported by Ryan Beisner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rabbitmq-server (Juju Charms Collection)
Fix Released
Undecided
Ryan Beisner

Bug Description

When nrpe is used with rabbitmq-server on Wily, the cron job which collects stats fails because the lockfile-create command isn't available (lockfile-progs package not installed in Wily deployments).

$ lockfile-create -r2 --lock-name /var/lock/rabbitmq-gather-metrics.lock
The program 'lockfile-create' is currently not installed. You can install it by typing:
sudo apt-get install lockfile-progs

...

This should fix it, validating...

=== modified file 'hooks/rabbit_utils.py'
--- hooks/rabbit_utils.py 2015-10-19 17:40:42 +0000
+++ hooks/rabbit_utils.py 2015-10-21 16:09:18 +0000
@@ -48,7 +48,7 @@

 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'

=== modified file 'scripts/collect_rabbitmq_stats.sh'
--- scripts/collect_rabbitmq_stats.sh 2015-08-27 01:44:56 +0000
+++ scripts/collect_rabbitmq_stats.sh 2015-10-21 16:08:18 +0000
@@ -8,6 +8,7 @@
 # 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

Related branches

Ryan Beisner (1chb1n)
description: updated
Ryan Beisner (1chb1n)
description: updated
Ryan Beisner (1chb1n)
Changed in rabbitmq-server (Juju Charms Collection):
assignee: nobody → Ryan Beisner (1chb1n)
status: New → Confirmed
status: Confirmed → In Progress
Ryan Beisner (1chb1n)
Changed in rabbitmq-server (Juju Charms Collection):
status: In Progress → Fix Committed
James Page (james-page)
Changed in rabbitmq-server (Juju Charms Collection):
milestone: none → 15.10
James Page (james-page)
Changed in rabbitmq-server (Juju Charms Collection):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.