Re: [Linux-ha-dev] [Pacemaker] A couple of SendArp resource changes

2013-05-29 Thread Dejan Muhamedagic
On Mon, Apr 08, 2013 at 02:33:27PM +0100, Tim Small wrote:
> On 13/03/13 18:01, Dejan Muhamedagic wrote:
> 
> > If you could split the
> > patch we can consider them on a one-by-one basis.
> 
> I used Debian's "start-stop-daemon" utility in my modified script, and
> it looks like Redhat etc. doesn't package it (yet): 
> http://fedoraproject.org/wiki/Features/start-stop-daemon 
> 
> ... the comments in that page express why I chose to use
> start-stop-daemon - reworking the script to have the same level of
> functionality as the start-stop-daemon version (but just using lsb
> stuff) would be a bit awkward + time-consuming.
> 
> How about I use start-stop-daemon where available, and the LSB functions
> when not?  This would still represent an improvement on the current
> behaviour of the script - which is pretty broken - e.g. stopping an
> already-stopped resource fails, and stuff like this:
> 
> 
> #
> #   This is always active, because it doesn't do much
> #
> sendarp_monitor() {
> return $OCF_SUCCESS
> }
> 
> 
> 
> and this:
> 
> 
> 
> sendarp_status() {
> if
> [ -f "$SENDARPPIDFILE" ]
> then
> return $OCF_SUCCESS
> else
> return $OCF_NOT_RUNNING
> fi
> }
> 
> 
> "A pid file is there, so it must be running!"

The fix for the resource agent itself is already in the
repository. It is based on the standard ha_pseudo_* functions
like in any other pseudo agents (i.e. those that don't have long
running processes).

> > Otherwise, I found some patch in my local queue, which never got pushed for 
> > some reason. Don't know if that would help (attached).
> >   
> 
> I'll have a go with them, and check to see if they fix the bug which I
> was seeing.

Did you get a chance to verify the two patches attached? There's
now also a pull request for the socket leaks issue at github.com:

https://github.com/ClusterLabs/resource-agents/pull/247

Cheers,

Dejan

> Tim.
> 
> 
> -- 
> South East Open Source Solutions Limited
> Registered in England and Wales with company number 06134732.  
> Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ
> VAT number: 900 6633 53  http://seoss.co.uk/ +44-(0)1273-808309
> 
> ___
> 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/


Re: [Linux-ha-dev] cluster-glue compilation problem

2013-05-29 Thread Dejan Muhamedagic
Hi,

On Mon, Apr 29, 2013 at 02:24:12PM +0200, khaled atteya wrote:
> Hi
> I tried to install glue pkg from source code , though i install net-snmp
> but when i run ./configure ,this message appear "checking for
> ucd-snmp/snmp.h... no" ,though /usr/include/ucd-snmp/snmp.h is existing ,
> what is the problem?

Sorry for the delay.

There seems to be an issue with ucd-snmp, i.e. some macro is
supposed to be defined. However, the alternative net-snmp should
be OK and both stonith plugins which need snmp support can use
either. Do you need ucd-snmp specifically for some reason?

> This problem also appear in other libraries.

Which other libraries do you refer to?

Thanks,

Dejan

> Thanks
> 
> -- 
> KHALED MOHAMMED ATTEYA
> System Engineer

> ___
> 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/


Re: [Linux-ha-dev] [PATCH][crmsh] deal with the case-insentive hostname

2013-05-29 Thread Junko IKEDA
Hi Dejan,

Sorry for no reply.
I tried this, and it works well!
http://hg.savannah.gnu.org/hgweb/crmsh/rev/1ebbf036c6d9

Many thanks for your review.

Thanks,
Junko


2013/5/29 Dejan Muhamedagic 

> On Tue, Apr 23, 2013 at 04:44:19PM +0200, Dejan Muhamedagic wrote:
> > Hi Junko-san,
> >
> > Can you try the attached patch, instead of this one?
>
> Any news? Was the patch any good?
>
> Cheers,
>
> Dejan
>
> > Cheers,
> >
> > Dejan
> >
> > On Wed, Apr 10, 2013 at 06:13:45PM +0900, Junko IKEDA wrote:
> > > Hi,
> > > I set upper-case hostname (GUEST03/GUEST4) and run Pacemaker 1.1.9 +
> > > Corosync 2.3.0.
> > >
> > > [root@GUEST04 ~]# crm_mon -1
> > > Last updated: Wed Apr 10 15:12:48 2013
> > > Last change: Wed Apr 10 14:02:36 2013 via crmd on GUEST04
> > > Stack: corosync
> > > Current DC: GUEST04 (3232242817) - partition with quorum
> > > Version: 1.1.9-e8caee8
> > > 2 Nodes configured, unknown expected votes
> > > 1 Resources configured.
> > >
> > >
> > > Online: [ GUEST03 GUEST04 ]
> > >
> > >  dummy  (ocf::pacemaker:Dummy): Started GUEST03
> > >
> > >
> > > for example, call crm shell with lower-case hostname.
> > >
> > > [root@GUEST04 ~]# crm node standby guest03
> > > ERROR: bad lifetime: guest03
> > >
> > > "crm node standby GUEST03" surely works well,
> > > so crm shell just doesn't take into account the hostname conversion.
> > > It's better to accept the both of the upper/lower-case.
> > >
> > > "node standby", "node delete", "resource migrate(move)"  get hit with
> this
> > > issue.
> > > Please see the attached.
> > >
> > > Thanks,
> > > Junko
> >
> >
> > > ___
> > > 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/
> >
>
> > # HG changeset patch
> > # User Dejan Muhamedagic 
> > # Date 1366728211 -7200
> > # Node ID cd4d36b347c17b06b76f3386c041947a03c708bb
> > # Parent  4a47465b1fe1f48123080b4336f0b4516d9264f6
> > Medium: node: ignore case when looking up nodes (thanks to Junko Ikeda)
> >
> > diff -r 4a47465b1fe1 -r cd4d36b347c1 modules/ui.py.in
> > --- a/modules/ui.py.inTue Apr 23 11:23:10 2013 +0200
> > +++ b/modules/ui.py.inTue Apr 23 16:43:31 2013 +0200
> > @@ -924,7 +924,7 @@ class RscMgmt(UserInterface):
> >  lifetime = None
> >  opt_l = fetch_opts(argl, ["force"])
> >  if len(argl) == 1:
> > -if not argl[0] in listnodes():
> > +if not is_node(argl[0]):
> >  lifetime = argl[0]
> >  else:
> >  node = argl[0]
> > @@ -1186,7 +1186,7 @@ class NodeMgmt(UserInterface):
> >  if not args:
> >  node = vars.this_node
> >  if len(args) == 1:
> > -if not args[0] in listnodes():
> > +if not is_node(args[0]):
> >  node = vars.this_node
> >  lifetime = args[0]
> >  else:
> > @@ -1249,7 +1249,7 @@ class NodeMgmt(UserInterface):
> >  'usage: delete '
> >  if not is_name_sane(node):
> >  return False
> > -if not node in listnodes():
> > +if not is_node(node):
> >  common_err("node %s not found in the CIB" % node)
> >  return False
> >  rc = True
> > diff -r 4a47465b1fe1 -r cd4d36b347c1 modules/xmlutil.py
> > --- a/modules/xmlutil.py  Tue Apr 23 11:23:10 2013 +0200
> > +++ b/modules/xmlutil.py  Tue Apr 23 16:43:31 2013 +0200
> > @@ -159,6 +159,15 @@ def mk_rsc_type(n):
> >  if ra_provider:
> >  s2 = "%s:"%ra_provider
> >  return ''.join((s1,s2,ra_type))
> > +def is_node(s):
> > +'''
> > +Check if s is in a list of our nodes (ignore case).
> > +This is not fast, perhaps should be cached.
> > +'''
> > +for n in listnodes():
> > +if n.lower() == s.lower():
> > +return True
> > +return False
> >  def listnodes():
> >  nodes_elem = cibdump2elem("nodes")
> >  if nodes_elem is None:
>
> > ___
> > 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/


Re: [Linux-ha-dev] [PATCH][crmsh] deal with the case-insentive hostname

2013-05-29 Thread Dejan Muhamedagic
On Tue, Apr 23, 2013 at 04:44:19PM +0200, Dejan Muhamedagic wrote:
> Hi Junko-san,
> 
> Can you try the attached patch, instead of this one?

Any news? Was the patch any good?

Cheers,

Dejan

> Cheers,
> 
> Dejan
> 
> On Wed, Apr 10, 2013 at 06:13:45PM +0900, Junko IKEDA wrote:
> > Hi,
> > I set upper-case hostname (GUEST03/GUEST4) and run Pacemaker 1.1.9 +
> > Corosync 2.3.0.
> > 
> > [root@GUEST04 ~]# crm_mon -1
> > Last updated: Wed Apr 10 15:12:48 2013
> > Last change: Wed Apr 10 14:02:36 2013 via crmd on GUEST04
> > Stack: corosync
> > Current DC: GUEST04 (3232242817) - partition with quorum
> > Version: 1.1.9-e8caee8
> > 2 Nodes configured, unknown expected votes
> > 1 Resources configured.
> > 
> > 
> > Online: [ GUEST03 GUEST04 ]
> > 
> >  dummy  (ocf::pacemaker:Dummy): Started GUEST03
> > 
> > 
> > for example, call crm shell with lower-case hostname.
> > 
> > [root@GUEST04 ~]# crm node standby guest03
> > ERROR: bad lifetime: guest03
> > 
> > "crm node standby GUEST03" surely works well,
> > so crm shell just doesn't take into account the hostname conversion.
> > It's better to accept the both of the upper/lower-case.
> > 
> > "node standby", "node delete", "resource migrate(move)"  get hit with this
> > issue.
> > Please see the attached.
> > 
> > Thanks,
> > Junko
> 
> 
> > ___
> > 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/
> 

> # HG changeset patch
> # User Dejan Muhamedagic 
> # Date 1366728211 -7200
> # Node ID cd4d36b347c17b06b76f3386c041947a03c708bb
> # Parent  4a47465b1fe1f48123080b4336f0b4516d9264f6
> Medium: node: ignore case when looking up nodes (thanks to Junko Ikeda)
> 
> diff -r 4a47465b1fe1 -r cd4d36b347c1 modules/ui.py.in
> --- a/modules/ui.py.inTue Apr 23 11:23:10 2013 +0200
> +++ b/modules/ui.py.inTue Apr 23 16:43:31 2013 +0200
> @@ -924,7 +924,7 @@ class RscMgmt(UserInterface):
>  lifetime = None
>  opt_l = fetch_opts(argl, ["force"])
>  if len(argl) == 1:
> -if not argl[0] in listnodes():
> +if not is_node(argl[0]):
>  lifetime = argl[0]
>  else:
>  node = argl[0]
> @@ -1186,7 +1186,7 @@ class NodeMgmt(UserInterface):
>  if not args:
>  node = vars.this_node
>  if len(args) == 1:
> -if not args[0] in listnodes():
> +if not is_node(args[0]):
>  node = vars.this_node
>  lifetime = args[0]
>  else:
> @@ -1249,7 +1249,7 @@ class NodeMgmt(UserInterface):
>  'usage: delete '
>  if not is_name_sane(node):
>  return False
> -if not node in listnodes():
> +if not is_node(node):
>  common_err("node %s not found in the CIB" % node)
>  return False
>  rc = True
> diff -r 4a47465b1fe1 -r cd4d36b347c1 modules/xmlutil.py
> --- a/modules/xmlutil.py  Tue Apr 23 11:23:10 2013 +0200
> +++ b/modules/xmlutil.py  Tue Apr 23 16:43:31 2013 +0200
> @@ -159,6 +159,15 @@ def mk_rsc_type(n):
>  if ra_provider:
>  s2 = "%s:"%ra_provider
>  return ''.join((s1,s2,ra_type))
> +def is_node(s):
> +'''
> +Check if s is in a list of our nodes (ignore case).
> +This is not fast, perhaps should be cached.
> +'''
> +for n in listnodes():
> +if n.lower() == s.lower():
> +return True
> +return False
>  def listnodes():
>  nodes_elem = cibdump2elem("nodes")
>  if nodes_elem is None:

> ___
> 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/