Hi Lars,

Somehow missed your post...

On Mon, Aug 22, 2011 at 09:05:09PM +0200, Lars Ellenberg wrote:
> On Fri, Aug 19, 2011 at 04:07:04PM +0200, jer...@intuxicated.org wrote:
> > 
> > On Wed, 3 Aug 2011 15:34:37 +0200, Dejan Muhamedagic <de...@suse.de> wrote:
> > > Hi Jeroen,
> > > 
> > > On Fri, Jul 22, 2011 at 10:51:56AM +0200, jer...@intuxicated.org wrote:
> > >> 
> > >> On Fri, 15 Apr 2011 14:45:59 +0200, "Raoul Bhatia [IPAX]"
> > >> <r.bha...@ipax.at>
> > >> wrote:
> > >> > On 04/15/2011 01:19 PM, Andrew Beekhof wrote:
> > >> >> On Fri, Apr 15, 2011 at 12:53 PM, Raoul Bhatia [IPAX]
> > >> >> <r.bha...@ipax.at>
> > >> >> wrote:
> > >> >>> On 04/15/2011 11:10 AM, jer...@intuxicated.org wrote:
> > >> >>>>
> > >> >>>> Yes, it does the same thing but contains some additional features,
> > >> like
> > >> >>>> logging into a mailbox.
> > >> >>>
> > >> >>> first of all, i do not know how the others think about a ocf ra
> > >> >>> implemented in c. i'll suggest waiting for comments from dejan or
> > >> >>> fghass.
> > >> >> 
> > >> >> the ipv6addr agent was written in C too
> > >> >> the OCF standard does not dictate the language to be used - its
> > really
> > >> >> a matter of whether C is the best tool for this job
> > >> > 
> > >> > thank you andrew!
> > >> > 
> > >> > jeroen, can you please create a github fork off
> > >> > https://github.com/ClusterLabs/ (it's really easy!)
> > >> > 
> > >> > and add your resource agent in the same fashion as IPv6addr.c [1] ?
> > >> > 
> > >> > thanks,
> > >> > raoul
> > >> > 
> > >> > [1]
> > >> >
> > >>
> > https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/IPv6addr.c
> > >> 
> > >> Hi,
> > >> 
> > >> I finally found some time to get the code on GitHub.
> > >> 
> > >> https://github.com/perrit/dovecot-ocf-resource-agent
> > >> 
> > >> As you can see it's kind of hard to merge the code in the same way as
> > >> IPv6addr.c as it currently spans multiple files. Would you like me to
> > >> just
> > >> put it in a directory? Maybe it's a good idea to split the dovecot part
> > >> and
> > >> the mailbox login part, so that there's a mailbox login resource agent
> > >> becomes more like the ping resource agent?
> > > 
> > > I really hate to say it, since you obviously invested quite a
> > > bit of time to put together this agent, but C is arguably not
> > > the best suited programming language for resource agents. I
> > > guess that's why all init scripts are, well, shell scripts. And
> > > all but one of our OCF resource agents. The code is around
> > > 4kloc, which is as big as some of our subsystems. That's a lot
> > > of code to read and maintain.
> > > 
> > > Was there a good reason to choose C for the implementation?
> > > 
> > > Cheers,
> > > 
> > > Dejan
> > > 
> > 
> > Hi Dejan,
> > 
> > Sorry for the late reply.
> > 
> > Well I the wanted to automatically decide which interfaces should be
> > monitored (POP3/IMAP). I had a lot of trouble parsing with sh/bash,
> 
> If trouble parsing the doveconf output was/is the main reason
> for using C, maybe I can help.
> 
> That should be fairly easy, actually,
> seeing that you only care about very few settings?
> 
> Especially if you change your doveconf invocation to
> doveconf -c $config_path base_dir listen shutdown_clients \
>       service/imap-login/inet_listener/{address,port,ssl} \
>       service/pop3-login/inet_listener/{address,port,ssl}
> 
> I don't see too much complexity there,
> but maybe I'm missing something.
> 
> > so I
> > decided this would easier to do in C. Most of the code is needed to imitate
> > the ocf bash functions in C, if those functions could be provided in a
> > library (which others could also benefit from of course), the resource
> > agent itself can be much, much smaller.
> > 
> > Maybe the the POP3/IMAP login part can be split from the dovecot specific
> > part, and provide a seperate resource agent, much like the ping resource
> > agent. So that other POP3/IMAP servers like courier or perdition for
> > example can also be monitored. The resource agent for the dovecot service
> > itself can then simply be written in sh/bash.
> > 
> > If I ever want to write a new resource agent, is there a list of basic
> > requirements somewhere to get the resource agent included?
> 
> sh or bash is probably much faster to get included.
> 
> If you have a previous version of this in python or bash,
> or could point out where your problems have been, maybe we can
> revive/write it in python or bash more quickly than getting the C
> version included?

Most probably. It is symptomatic that all but one of our RA are
implemented in shell.

> I'm offering my help with doing it in bash.
> If you don't want to go that way, that is ok with me, too.
> 
> It certainly won't hurt to have a set of C ocf library functions around
> for cases where it really is easier do get the job done in C.

Ack.

Thanks,

Dejan

>       Lars
> 
> -- 
> : Lars Ellenberg
> : LINBIT | Your Way to High Availability
> : DRBD/HA support and consulting http://www.linbit.com
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to