On Tue, 19 Jul 2011, Giampaolo Rodolà wrote:

By digging into commit history I found this:
http://www.mail-archive.com/mon@linux.kernel.org/msg00828.html
...so I picked up latest development version from
https://mon.wiki.kernel.org/index.php/Development and replaced the main mon
executable but that didn't fix the problem.

let me know if the attached patch helps. watch the syslog "info"
output for "master alert pid", "child alert pid", and "reaped pid".
there should be one "reaped pid" for every "alert pid", assuming all
alert processes are exiting properly.

if that doesn't help, send a process tree output showing the zombies so
i can see whose zombies they are, actually.
Index: mon
===================================================================
RCS file: /cvsroot/mon/mon/mon,v
retrieving revision 1.27
diff -u -r1.27 mon
--- mon 20 Jun 2011 17:26:25 -0000      1.27
+++ mon 19 Jul 2011 11:54:30 -0000
@@ -3223,11 +3223,14 @@
     my ($summary, $tmnow, $buf);
 
     $tmnow = time;
-    return if (keys %running == 0);
 
     while ((my $p = waitpid (-1, &WNOHANG)) >0)
     {
-       next if (!exists $runningpid{$p});
+       if (!exists $runningpid{$p})
+       {
+           syslog ("info", "reaped pid $p");
+           next;
+       }
        my ($group, $service) = split (/\//, $runningpid{$p});
        my $sref = \%{$watch{$group}->{$service}};
 
@@ -5018,12 +5021,14 @@
     my $pid;
     if ($pid = fork()) {  ## Master
        # Do Nothing
+       syslog ("info", "master alert pid $pid");
     } elsif (defined($pid)) { ## Child
        my $pid = open (ALERT, "|-");
        if (!defined $pid) {
            syslog ('err', "could not fork: $!");
            return undef;
        }
+       syslog ("info", "child alert pid $pid");
 
        #
        # grandchild, the actual alert
_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to