httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: dean, you say solaris still fails?
Date Fri, 01 Aug 1997 07:33:53 GMT
On Fri, 1 Aug 1997, Marc Slemko wrote:

> I can't make it fail[1] when using the below patch.

Ok I'm assuming you're talking about 1.2.1 + the first solaris_hup.patch +
the patch you just posted. 

> You just listening on one port?  Any listen directives?

One port, no Listen.

What I see is quite odd.  I start the server, I make a single connection.
Then I send it a HUP.  Now if I do a "netstat -an | grep port#" it shows
that the socket is in BOUND, not in LISTEN.  If I try to telnet to it
I get connection refused.

I tried a few things that didn't work, including checking the error
code on listen(), -DNO_LINGCLOSE.  But I found something that does work:
moving the ap_slack after the listen().  In addition I block the HUP and
USR1 signals during a restart, and now it'll pass a while 1; kill -HUP.

I haven't looked to see that those sockopts are actually inherited
properly after the dup.

The patch below 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