spamassassin-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzilla-dae...@bugzilla.spamassassin.org
Subject [Bug 3743] Spamd not cleaning up defunct processes
Date Fri, 03 Sep 2004 01:27:13 GMT
http://bugzilla.spamassassin.org/show_bug.cgi?id=3743





------- Additional Comments From jm@jmason.org  2004-09-02 18:27 -------
er, theo, I think the waitpid() version is what shane's suggesting.  current svn
has:

sub child_handler {
  my ($sig) = @_;
  $SIG{CHLD} = \&child_handler;    # reset as necessary
  my $pid = wait;                  # reap the child
  delete $children{$pid};          # remove the child out of the pool
  logmsg("server hit by SIG$sig, pid $pid");
}

sub restart_handler {
  my ($sig) = @_;
  logmsg("server hit by SIG$sig, restarting");

  $SIG{CHLD} = 'DEFAULT';    # we're going to kill our children
  foreach (keys %children) {
    kill 'INT' => $_;
    my $pid = wait;
    logmsg("child $pid killed successfully");
  }
  %children = ();


ie. wait().   so shane's fix looks good -- I think....

/me hates the UNIX SIGCHLD portability-nightmare



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Mime
View raw message