LP#1739044: fix lock file detection in eg-pbx-allocator.pl
authorJosh Stompro <stomproj@larl.org>
Tue, 19 Dec 2017 14:37:55 +0000 (08:37 -0600)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 30 Apr 2018 14:21:35 +0000 (10:21 -0400)
commit06f53412cdceedb7f61f3fa31fbc849676c352d6
tree24d42a98c73ae2e40bd4a04575b89949b42967d3
parent5b56f6242f641b225b011ad25c57b2f63d3749c5
LP#1739044: fix lock file detection in eg-pbx-allocator.pl

Lock file detection wasn't working correctly.  The
wrong operator was used to read the contents of the lock file.

Testing:

Running the eg-pbx-allocator.pl in the background multiple times will
trigger the lock file detection.  Use -t to run in test mode to avoid
moving any files while testing.

/usr/local/bin/eg-pbx-allocator.pl -t -v -c /usr/local/etc/eg-pbx-daemon.conf &
/usr/local/bin/eg-pbx-allocator.pl -t -v -c /usr/local/etc/eg-pbx-daemon.conf

In syslog you can see entries that are missing the PID number when you test
before the fix is installed.

virt-asterisk1 eg-pbx-allocator.pl: lock file present (/tmp/eg-pbx-allocator-LOCK),  still running

after the fix is installed, you will see the PID in the syslog entry.

virt-asterisk1 eg-pbx-allocator.pl: lock file present (/tmp/eg-pbx-allocator-LOCK), 21039 still running

Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/asterisk/pbx-daemon/eg-pbx-allocator.pl