Reload not working after installing 2.7.0

Tuomo Soini tis at foobar.fi
Fri Jul 8 14:06:48 CEST 2011


Bob Mortimer wrote:
> I've just upgraded my installation from (I think) 2.6.4 and all's
> working fine except 'service amavisd reload' no longer works. I get:
> 
> Reloading amavisd: Signalling a SIGHUP to a running daemon [9701] [  OK  ]
> 
> But amavisd isn't running, I get a connection refused message and need
> to issue either a start or restart to get it going.
> 
> I run a daily crontab "sa-update -D && service amavisd reload" which now
> won't work.

> Any suggestions?

Which version of Net::Server. Some versions need for patch Net::Server
to get reload working. That's a bug in Net::Server.

Fix by Mark is:

diff -up Net-Server-0.97/lib/Net/Server/PreFork.pm.waitpid
Net-Server-0.97/lib/Net/Server/PreFork.pm
--- Net-Server-0.97/lib/Net/Server/PreFork.pm.waitpid   2007-03-24
00:21:51.000000000 +0200
+++ Net-Server-0.97/lib/Net/Server/PreFork.pm   2011-03-04
19:00:42.000000000 +0200
@@ -325,6 +325,15 @@ sub run_parent {
 #               },
                );

+  ### reclaim process exit status from any terminated child process
+  ### inherited from a previous incarnation whose SIGCHLD signal was
+  ### ignored during a blind period between a restart and the moment
+  ### when the SIGCHLD handler was established just now
+  while ( defined(my $chld = waitpid(-1, WNOHANG)) ){
+      last unless $chld > 0;
+      $self->{reaped_children}->{$chld} = 1;
+  }
+
   ### loop on reading info from the children
   while( 1 ){

diff -up Net-Server-0.97/lib/Net/Server/PreForkSimple.pm.waitpid
Net-Server-0.97/lib/Net/Server/PreForkSimple.pm
--- Net-Server-0.97/lib/Net/Server/PreForkSimple.pm.waitpid
2007-03-26 17:32:05.000000000 +0300
+++ Net-Server-0.97/lib/Net/Server/PreForkSimple.pm     2011-03-04
19:01:57.000000000 +0200
@@ -331,6 +331,15 @@ sub run_parent {
 #               },
                );

+  ### reclaim process exit status from any terminated child process
+  ### inherited from a previous incarnation whose SIGCHLD signal was
+  ### ignored during a blind period between a restart and the moment
+  ### when the SIGCHLD handler was established just now
+  while ( defined(my $chld = waitpid(-1, WNOHANG)) ){
+      last unless $chld > 0;
+      $self->delete_child($chld);
+  }
+
   ### loop forever
   while( 1 ){



-- 
Tuomo Soini <tis at foobar.fi>
Foobar Linux services
+358 40 5240030
Foobar Oy <http://foobar.fi/>


More information about the amavis-users mailing list