When invoked by cman, stdin is used to pass in the options. So this problem only occurs when you run it from the command line - which shouldn't be necessary.
I've not yet found better loop logic but you can work around the problem by running with < /dev/null On Mon, Nov 21, 2011 at 9:15 AM, Brendan Regan <[email protected]> wrote: > Hi, > I am having a problem with the fence_pcmk agent. It seem to be getting > stuck in an infinite loop in this while loop: > > while( defined($in = <>) ) > { > $_ = $in; > chomp; > # strip leading and trailing whitespace > s/^\s*//; > s/\s*$//; > # skip comments > next if /^#/; > $line+=1; > $opt=$_; > next unless $opt; > I verified this using perl –d and stepping through the code. > If I understand this correctly the script should leave the loop when the > value of $in becomes undefined or if $opt is true. > I have been trying to figure out if I am missing some Perl module. I > included a list below of the load modules when running the script with perl > –d > When I run the script with perl –w I get the following: > > /usr/bin/perl -w /usr/sbin/fence_pcmk -o status > print (...) interpreted as function at /usr/sbin/fence_pcmk line 174. > Name "main::extra_args" used only once: possible typo at > /usr/sbin/fence_pcmk line 21. > Name "main::pid" used only once: possible typo at /usr/sbin/fence_pcmk line > 150. > > I am running: > pacemaker 1.1.6 > corosync 1.3.3 > cman 3.1.5 > Perl 5.12.4 > Loading DB routines from perl5db.pl version 1.33 > Editor support available. > Enter h or `h h' for help, or `man perldebug' for more help. > main::(/usr/sbin/fence_pcmk:5): my $ME = $0; > DB<1> M > 'Carp.pm' => '1.17 from /usr/lib64/perl5/5.12.4/Carp.pm' > 'Exporter.pm' => '5.64_01 from /usr/lib64/perl5/5.12.4/Exporter.pm' > 'Exporter/Heavy.pm' => '5.64_01 from > /usr/lib64/perl5/5.12.4/Exporter/Heavy.pm' > 'Getopt/Long.pm' => '2.38 from > /usr/lib64/perl5/vendor_perl/5.12.4/Getopt/Long.pm' > 'IO.pm' => '1.25 from > /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/IO.pm' > 'IO/Handle.pm' => '1.28 from > /usr/lib64/perl5/vendor_perl/5.12.4/x86_64-linux/IO/Handle.pm' > 'SelectSaver.pm' => '1.02 from /usr/lib64/perl5/5.12.4/SelectSaver.pm' > 'Symbol.pm' => '1.07 from /usr/lib64/perl5/5.12.4/Symbol.pm' > 'Term/Cap.pm' => '1.12 from /usr/lib64/perl5/5.12.4/Term/Cap.pm' > 'Term/ReadLine.pm' => '1.05 from /usr/lib64/perl5/5.12.4/Term/ReadLine.pm' > 'XSLoader.pm' => '0.10 from /usr/lib64/perl5/5.12.4/XSLoader.pm' > 'constant.pm' => '1.20 from /usr/lib64/perl5/5.12.4/constant.pm' > 'overload.pm' => '1.10 from /usr/lib64/perl5/5.12.4/overload.pm' > 'perl5db.pl' => '1.33 from /usr/lib64/perl5/5.12.4/perl5db.pl' > 'strict.pm' => '1.04 from /usr/lib64/perl5/5.12.4/strict.pm' > 'vars.pm' => '1.01 from /usr/lib64/perl5/5.12.4/vars.pm' > 'warnings.pm' => '1.09 from /usr/lib64/perl5/5.12.4/warnings.pm' > 'warnings/register.pm' => '1.01 from > /usr/lib64/perl5/5.12.4/warnings/register.pm' > DB<1> > > Thanks for you assistance. > Brendan Regan > > _______________________________________________ > Pacemaker mailing list: [email protected] > http://oss.clusterlabs.org/mailman/listinfo/pacemaker > > Project Home: http://www.clusterlabs.org > Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf > Bugs: > http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker > > _______________________________________________ Pacemaker mailing list: [email protected] http://oss.clusterlabs.org/mailman/listinfo/pacemaker Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
