Mailing List Archive

Fwd: [lvs-users] defunct checkcommand processes w/ ldirectord
Hi,

A bug report and a proposed patch to ldirectord were posted to
lvs-users ML a little while ago.
I think it's worth to include.

http://lists.graemef.net/pipermail/lvs-users/2012-February/024430.html

---------- Forwarded message ----------
From: Sohgo Takeuchi <sohgo@sohgo.dyndns.org>
Date: 2012/2/11
Subject: Re: [lvs-users] defunct checkcommand processes w/ ldirectord
To: lvs-users@linuxvirtualserver.org, david@davidcoulson.net



Hello, David

From: David Coulson <david@davidcoulson.net>
|
> I'm running ldirectord with a few external checkcommands, but end up
> with numerous defunct processes on the system.
>
> Seems like this issue:
>
> http://archive.linuxvirtualserver.org/html/lvs-users/2010-08/msg00040.html
>
> I realize I can set an alarm on my command and cause it to exit, but is
> there a fix for ldirectord to correctly clean up processes which are
> killed due to the internal timeout?

Please try the following patch.

diff --git a/ldirectord/ldirectord.in b/ldirectord/ldirectord.in
index 5d26114..c28eb40 100644
--- a/ldirectord/ldirectord.in
+++ b/ldirectord/ldirectord.in
@@ -2671,19 +2671,21 @@ sub run_child
       my $real = $$v{real};
       my $virtual_id = get_virtual_id_str($v);
       my $checkinterval = $$v{checkinterval} || $CHECKINTERVAL;
       $0 = "ldirectord $virtual_id";
       while (1) {
               foreach my $r (@$real) {
                       $0 = "ldirectord $virtual_id checking $$r{server}";
                       _check_real($v, $r);
+                       check_signal();
               }
               $0 = "ldirectord $virtual_id";
               sleep $checkinterval;
+               check_signal();
               ld_emailalert_resend();
       }
 }

 sub _check_real
 {
       my $v = shift;
       my $r = shift;

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
Send requests to lvs-users-request@LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


Thanks,
--
Keisuke MORI
_______________________________________________________
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: Fwd: [lvs-users] defunct checkcommand processes w/ ldirectord [ In reply to ]
Hi,

On Thu, Mar 01, 2012 at 11:42:57AM +0900, Keisuke MORI wrote:
> Hi,
>
> A bug report and a proposed patch to ldirectord were posted to
> lvs-users ML a little while ago.
> I think it's worth to include.
>
> http://lists.graemef.net/pipermail/lvs-users/2012-February/024430.html

Looks ok to me, but was Horms listening? Horms, what do you say?

Cheers,

Dejan

> ---------- Forwarded message ----------
> From: Sohgo Takeuchi <sohgo@sohgo.dyndns.org>
> Date: 2012/2/11
> Subject: Re: [lvs-users] defunct checkcommand processes w/ ldirectord
> To: lvs-users@linuxvirtualserver.org, david@davidcoulson.net
>
>
>
> Hello, David
>
> From: David Coulson <david@davidcoulson.net>
> |
> > I'm running ldirectord with a few external checkcommands, but end up
> > with numerous defunct processes on the system.
> >
> > Seems like this issue:
> >
> > http://archive.linuxvirtualserver.org/html/lvs-users/2010-08/msg00040.html
> >
> > I realize I can set an alarm on my command and cause it to exit, but is
> > there a fix for ldirectord to correctly clean up processes which are
> > killed due to the internal timeout?
>
> Please try the following patch.
>
> diff --git a/ldirectord/ldirectord.in b/ldirectord/ldirectord.in
> index 5d26114..c28eb40 100644
> --- a/ldirectord/ldirectord.in
> +++ b/ldirectord/ldirectord.in
> @@ -2671,19 +2671,21 @@ sub run_child
>        my $real = $$v{real};
>        my $virtual_id = get_virtual_id_str($v);
>        my $checkinterval = $$v{checkinterval} || $CHECKINTERVAL;
>        $0 = "ldirectord $virtual_id";
>        while (1) {
>                foreach my $r (@$real) {
>                        $0 = "ldirectord $virtual_id checking $$r{server}";
>                        _check_real($v, $r);
> +                       check_signal();
>                }
>                $0 = "ldirectord $virtual_id";
>                sleep $checkinterval;
> +               check_signal();
>                ld_emailalert_resend();
>        }
>  }
>
>  sub _check_real
>  {
>        my $v = shift;
>        my $r = shift;
>
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users
>
>
> Thanks,
> --
> Keisuke MORI
> _______________________________________________________
> 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/