[Pacemaker] Fence_pcmk hangs

Andrew Beekhof andrew at beekhof.net
Sun Nov 20 20:03:36 EST 2011


On Mon, Nov 21, 2011 at 10:14 AM, Brendan Regan <bregan at paragusit.com> wrote:
>
>  Hi Andrew,
>
> I originally encountered the problem when I ran ccs_update_schema -f -v it
> hangs when it gets to fence_pcmk
>
> Generating resource-agents cache
>  ras: checking required files
>  ras: cannot find rng files. Creating stubs
> Generating fence-agents cache
>  fas: checking required files
>  fas: looking for agents
>  fas: generating hashes
>  fas: generating new cache
>  fas: processing fence_ack_manual
>  fas: processing fence_alom
>  fas: processing fence_apc
>  fas: processing fence_apc_snmp
>  fas: processing fence_baytech
>  fas: processing fence_bladecenter
>  fas: processing fence_brocade
>  fas: processing fence_bullpap
>  fas: processing fence_cisco_mds
>  fas: processing fence_cisco_ucs
>  fas: processing fence_cpint
>  fas: processing fence_drac
>  fas: processing fence_drac5
>  fas: processing fence_eaton_snmp
>  fas: processing fence_egenera
>  fas: processing fence_eps
>  fas: processing fence_ibmblade
>  fas: processing fence_ifmib
>  fas: processing fence_ilo
>  fas: processing fence_ilo_mp
>  fas: processing fence_intelmodular
>  fas: processing fence_ipmilan
>  fas: processing fence_ldom
>  fas: processing fence_lpar
>  fas: processing fence_mcdata
>  fas: processing fence_na
>  fas: processing fence_pcmk
>
> Same thing happens when I run ccs_config_validate -v
>
>
> Creating temporary file: /tmp/tmp.oqBpCC5SEx
> Config interface set to: xmlconfig:cmanpreconfig
> Configuration stored in temporary file
> Updating relaxng schema
>
>
>
> /etc/cluster/cluster.conf
> <?xml version="1.0"?>
> <cluster config_version="1" name="GenSAN">
>  <logging debug="off"/>
>  <clusternodes>
>    <clusternode name="GenSAN1" nodeid="1">
>      <fence>
>        <method name="pcmk-redirect">
>          <device name="pcmk" port="GenSAN1"/>
>        </method>
>      </fence>
>    </clusternode>
>    <clusternode name="GenSAN2" nodeid="2">
>      <fence>
>        <method name="pcmk-redirect">
>          <device name="pcmk" port="GenSAN2"/>
>        </method>
>      </fence>
>    </clusternode>
>  </clusternodes>
>  <fencedevices>
>    <fencedevice name="pcmk" agent="fence_pcmk"/>
>  </fencedevices>
> </cluster>
>
>
>
> Is there reason why the script would behave like this when called from
> cman scripts?

I dont know what the scripts do.

> Seems like the script isn't processing input properly.

Correct.

Try the following patch:

diff --git a/fencing/fence_pcmk b/fencing/fence_pcmk
index e071da5..3b7a887 100755
--- a/fencing/fence_pcmk
+++ b/fencing/fence_pcmk
@@ -132,9 +132,10 @@ if (@ARGV > 0) {
    version if defined $opt_V;

    fail_usage "Unknown parameter." if (@ARGV > 0);
-}

-get_options_stdin();
+} else {
+    get_options_stdin();
+}

 $opt_o=lc($opt_o);
 fail "failed: unrecognised action: $opt_o"


>
> Thanks for your help,
>
> Brendan
>
> On 11/20/11 5:27 PM, "Andrew Beekhof" <andrew at beekhof.net> wrote:
>
>>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 <bregan at paragusit.com>
>>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: Pacemaker at oss.clusterlabs.org
>>> 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: Pacemaker at oss.clusterlabs.org
>>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: Pacemaker at oss.clusterlabs.org
> 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
>




More information about the Pacemaker mailing list