httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [STATUS] Apache 1.2.2 (Sat 2-Aug-1997 17:53 MET DST)
Date Sat, 02 Aug 1997 20:02:42 GMT


On Sat, 2 Aug 1997, Ralf S. Engelschall wrote:

>     o [patch.solarisdup]
>       Dean's patch for the solaris which superseeds
>       "PR#832: solaris -HUP problem with slack fd"
>       ** Marc has also found a way for Solaris with slacking **
>       ** We have to wait for a final solution which really works... **
>       Status: Dean +1, RSE +0, Ken +1
>       => ** WAITING IN QUEUE BECAUSE WE ARE
>             STILL NOT SURE WHICH FIX SHOULD BE TAKEN:
>             - the existing already comitted one?
>             - this one which superseeds the existing one?
>             - or a (still not available) patch based on Marc's new way? **

Ok the latest status is that Marc posted his patch, but it didn't work for
me.  Then I found something that works for me, and posted it.  But Marc
hasn't had a chance yet to try it.  I have sent my latest patch to the PR
submitters to see if it works for them.

Here is my patch again.  It moves ap_slack after all of the rest of the
socket initialization, I think the critical steps are the SO_REUSEADDR and
the listen().  It also blocks SIGHUP and SIGUSR1 during restart, which
makes it pass a "while 1; kill -HUP or kill -USR1" test. 

This is against vanilla 1.2.1. 

Dean

--- apache_1.2.1-dist/src/http_main.c	Sun Jun 29 11:08:37 1997
+++ apache_1.2.1/src/http_main.c	Fri Aug  1 00:27:38 1997
@@ -1982,9 +1982,16 @@
         exit(1);
     }
 
+    /* Solaris (probably versions 2.4, 2.5, and 2.5.1 with various levels
+     * of tcp patches) has some really weird bugs where if you dup the
+     * socket now it breaks things across SIGHUP restarts.  It'll either
+     * be unable to bind, or it won't respond.
+     */
+#ifndef SOLARIS2
     s = ap_slack(s, AP_SLACK_HIGH);
 
     note_cleanups_for_fd(pconf, s); /* arrange to close on exec or restart */
+#endif
     
 #ifndef MPE
 /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */
@@ -2053,6 +2060,12 @@
     if (ntohs(server->sin_port) < 1024) GETUSERMODE();
 #endif
     listen(s, 512);
+
+#ifdef SOLARIS2
+    s = ap_slack(s, AP_SLACK_HIGH);
+
+    note_cleanups_for_fd(pconf, s); /* arrange to close on exec or restart */
+#endif
     return s;
 }
 
@@ -2278,6 +2291,8 @@
 	}
 
 	/* we've been told to restart */
+        signal (SIGHUP, SIG_IGN);
+        signal (SIGUSR1, SIG_IGN);
 
 	if (one_process) {
 	    /* not worth thinking about */



Mime
View raw message