eg_pbx_allocator.pl - lock file detection warnings

Bug #1739044 reported by Josh Stompro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Low
Unassigned
2.12
Won't Fix
Low
Unassigned
3.1
Fix Released
Low
Unassigned

Bug Description

Hello, when the eg-pbx-allocator.pl detects an already existing lock file, the following warnings are detected.

Use of uninitialized value $pid in scalar chomp at /usr/local/bin/eg-pbx-allocator.pl line 255.
Use of uninitialized value $pid in concatenation (.) or string at
+/usr/local/bin/eg-pbx-allocator.pl line 259.
Use of uninitialized value $pid in concatenation (.) or string at
+/usr/local/bin/eg-pbx-allocator.pl line 260.
lock file present! at /usr/local/bin/eg-pbx-allocator.pl line 264.
verbose output ON

I think that the lock file detection code isn't correct.
http://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/asterisk/pbx-daemon/eg-pbx-allocator.pl;h=2db674f35a537ee068bf8d5218041b8ab85db8d0;hb=HEAD#l252

 252 sub lock_file_test {
 253 if (open FH, $config{lock_file}) {
 254 my $pid = <>;
 255 chomp $pid;
 256 close FH;

I think that "my $pid = <>;" isn't correct, that seems to be waiting for STDIN or a filename from the command line. I think it should be "my $pid = <FH>;"

Working branch on the way.
Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :
tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

Works for me. Signoff branch here: user/gmcharlt/lp1739044_signoff

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Low
milestone: none → 3.0.5
tags: added: signedoff
Changed in evergreen:
milestone: 3.0.5 → 3.0.6
Changed in evergreen:
milestone: 3.0.6 → 3.0.7
Changed in evergreen:
milestone: 3.0.7 → 3.0.8
Revision history for this message
Galen Charlton (gmc) wrote :

I've gone ahead and merged this to master, rel_3_1, and rel_3_0. Thanks, Josh!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
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.