[Pacemaker] Bug in "ping" pacemaker resource agent

Andrew Beekhof andrew at beekhof.net
Thu Jan 28 06:45:19 EST 2010


Oh, someone else reported this to me just the other day.
/me goes to check in the patch...

The reason is that bash is expanding * to be the names of files in the
current directory.
So as long at its empty (i think its the core files directory) it will
work fine.

Highly annoying

On Thu, Jan 28, 2010 at 11:11 AM, Moritz Krinke
<mkrinke at fotocommunity.net> wrote:
> Hello,
>
> i was struggling with the ping resource agent since it stopped working and i had some log entries about syntax errors for "expr".
>
> Around line 244 in the ping script, the score is getting calculated like this:
>
>    score=`expr $active * $OCF_RESKEY_multiplier`
>
> This doesnt work since the asterisk "*" must be escaped.
>
> I have no idea why it did work for some time, but this fixes it:
>
>    score=`expr $active \* $OCF_RESKEY_multiplier`
>
> or one could use let instead of expr
>
>    let score=$active*$OCF_RESKEY_multiplier
>
> but maybe the bash builtin is faster?
>
>        score=$((active * OCF_RESKEY_multiplier))
>
>
> Regards,
>
> Moritz
> _______________________________________________
> Pacemaker mailing list
> Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>




More information about the Pacemaker mailing list