[ClusterLabs Developers] Resource Agent language discussion
Jehan-Guillaume de Rorthais
jgdr at dalibo.com
Tue Aug 11 03:34:16 EDT 2015
On Tue, 11 Aug 2015 11:30:03 +1000
Andrew Beekhof <andrew at beekhof.net> wrote:
> > On 8 Aug 2015, at 1:14 am, Jehan-Guillaume de Rorthais <jgdr at dalibo.com>
> > wrote:
> > Hi Jan,
> > On Fri, 7 Aug 2015 15:36:57 +0200
> > Jan Pokorný <jpokorny at redhat.com> wrote:
> >> On 07/08/15 12:09 +0200, Jehan-Guillaume de Rorthais wrote:
> >>> Now, I would like to discuss about the language used to write a RA in
> >>> Pacemaker. I never seen discussion or page about this so far.
> >> it wasn't in such a "heretic :)" tone, but I tried to show that it
> >> is extremely hard (if not impossible in some instances) to write
> >> bullet-proof code in bash (or POSIX shell, for that matter) because
> >> it's so cumbersome to move from "whitespace-delimited words as
> >> a single argument" and "words as standalone arguments" back and forth,
> >> connected with quotation-desired/-counterproductive madness
> >> (what if one wants to indeed pass quotation marks as legitimate
> >> characters within the passed value, etc.) few months back:
> >> http://clusterlabs.org/pipermail/users/2015-May/000403.html
> >> (even on developers list, but with fewer replies and broken threading:
> >> http://clusterlabs.org/pipermail/developers/2015-May/000023.html).
> > Thanks for the links and history. You add some more argument to my points :)
> >>> HINT: I don't want to discuss (neither troll about) what is the best
> >>> language. I would like to know why **ALL** the RA are written in
> >>> bash
> >> I would expect the original influence were the init scripts (as RAs
> >> are mostly just enriched variants to support more flexible
> >> configuration and better diagnostics back to the cluster stack),
> >> which in turn were born having simplicity and ease of debugging
> >> (maintainability) in mind.
> > That sounds legitimate. And bash is still appropriate for some simple RA.
> > But for the same ease of code debugging and maintainability arguments (and
> > many others), complexe RA shouldn't use shell as language.
> You can and should use whatever language you like for your own private RAs.
> But if you want it accepted and maintained by the resource-agents project,
> you would be advised to use the language they have standardised on.
Well, let's imagine our RA was written in bash (in fact, we have a bash version
pretty close to the current perl version we abandoned). I wonder if it would be
accepted in the resource-agents project anyway as another one already exists
there. I can easily list the reasons we rewrote a new one, but this is not the
The discussion here is more about the language, if I should extract a
ocf-perl-module from my RA and if there is any chance the resource-agents
project would accept it.
More information about the Developers