You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/09/17 19:53:37 UTC

[PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

This should resolve Roy's veto by switching back to SIGUSR1 for
graceful restarts (except on Linux 2.0 with glibc 2.0).

As I don't think you can veto a veto (call a vote?), I don't think
his veto can be overriden.  But, I do want to post this before I 
commit it as it is a widespread change and I may have missed 
something.  We could extend this even further so that SIGHUP is 
also defined as a #define, but I'm not terribly sure we want to 
be that extreme.

The docs also need to be updated, but I'm not sure the best way
to phrase that it is SIGUSR1 except on one incredibly old platform
that no one should be using threads with anyway.  -- justin

Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.358
diff -u -r1.358 CHANGES
--- CHANGES	2001/09/06 23:58:29	1.358
+++ CHANGES	2001/09/17 17:28:48
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.26-dev
 
+  *) Switch back to SIGUSR1 for graceful restarts on all platforms that
+     support it.  [Justin Erenkrantz]
+
   *) Rewrite find_start_sequence to use a better search algorithm
      to find the start tag.  [Justin Erenkrantz]
 
Index: configure.in
===================================================================
RCS file: /home/cvs/httpd-2.0/configure.in,v
retrieving revision 1.179
diff -u -r1.179 configure.in
--- configure.in	2001/09/15 11:44:55	1.179
+++ configure.in	2001/09/17 17:28:48
@@ -142,6 +142,8 @@
 APACHE_SUBST(SHLTCFLAGS)
 APACHE_SUBST(LTCFLAGS)
 
+AP_RESTART_SIGNAL=SIGUSR1
+
 case $host in
   *-apple-aux3*)
       APR_SETVAR(APACHE_MPM, [prefork])
@@ -157,7 +159,11 @@
       ;;
   *-linux-*)
       case `uname -r` in
-        2.[[2-9]]* ) APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
+        2.0* ) 
+            AP_RESTART_SIGNAL=SIGWINCH
+            ;;
+        2.[[2-9]]* ) 
+            APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
             ;;
         * )
             ;;
@@ -346,6 +352,10 @@
     AC_DEFINE(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, 1, 
               [This platform doesn't suffer from the thundering herd problem])
 fi
+
+AC_DEFINE_UNQUOTED(AP_RESTART_SIGNAL, $AP_RESTART_SIGNAL, [Signal used to gracefully restart])
+AC_DEFINE_UNQUOTED(AP_RESTART_SIGNAL_STRING, "$AP_RESTART_SIGNAL", [Signal used to gracefully restart (as a quoted string)])
+AC_SUBST(AP_RESTART_SIGNAL)
 
 dnl check for endianness
 if test "$cross_compiling" = "no"; then
Index: modules/generators/mod_cgid.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
retrieving revision 1.97
diff -u -r1.97 mod_cgid.c
--- modules/generators/mod_cgid.c	2001/08/27 20:25:42	1.97
+++ modules/generators/mod_cgid.c	2001/09/17 17:28:53
@@ -238,10 +238,10 @@
         case APR_OC_REASON_LOST:
             /* it would be better to restart just the cgid child
              * process but for now we'll gracefully restart the entire 
-             * server by sending SIGWINCH to ourself, the httpd parent
-             * process
+             * server by sending AP_RESTART_SIGNAL to ourself, the httpd 
+             * parent process
              */
-            kill(getpid(), SIGWINCH);
+            kill(getpid(), AP_RESTART_SIGNAL);
             break;
         case APR_OC_REASON_RESTART:
             apr_proc_other_child_unregister(data);
Index: modules/mappers/mod_so.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_so.c,v
retrieving revision 1.42
diff -u -r1.42 mod_so.c
--- modules/mappers/mod_so.c	2001/06/07 10:38:13	1.42
+++ modules/mappers/mod_so.c	2001/09/17 17:28:53
@@ -59,8 +59,8 @@
 /* 
  * This module is used to load Apache modules at runtime. This means that the
  * server functionality can be extended without recompiling and even without
- * taking the server down at all. Only a HUP or WINCH signal needs to be send
- * to the server to reload the dynamically loaded modules.
+ * taking the server down at all. Only a HUP or AP_RESTART_SIGNAL signal 
+ * needs to be sent to the server to reload the dynamically loaded modules.
  *
  * To use, you'll first need to build your module as a shared library, then
  * update your configuration (httpd.conf) to get the Apache core to load the
@@ -98,9 +98,9 @@
  * directive to get these log messages).
  *
  * If you edit the LoadModule directives while the server is live you can get
- * Apache to re-load the modules by sending it a HUP or WINCH signal as normal.
- * You can use this to dynamically change the capability of your server
- * without bringing it down.
+ * Apache to re-load the modules by sending it a HUP or AP_RESTART_SIGNAL 
+ * signal as normal.  You can use this to dynamically change the capability 
+ * of your server without bringing it down.
  *
  * Because currently there is only limited builtin support in the Configure
  * script for creating the shared library files (`.so'), please consult your
Index: server/log.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/log.c,v
retrieving revision 1.96
diff -u -r1.96 log.c
--- server/log.c	2001/07/30 17:55:38	1.96
+++ server/log.c	2001/09/17 17:28:55
@@ -527,7 +527,7 @@
     mypid = getpid();
     if (mypid != saved_pid 
          && apr_stat(&finfo, fname, APR_FINFO_MTIME, p) == APR_SUCCESS) {
-      /* WINCH and HUP call this on each restart.
+      /* AP_RESTART_SIGNAL and HUP call this on each restart.
        * Only warn on first time through for this pid.
        *
        * XXX: Could just write first time through too, although
Index: server/mpm_common.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.66
diff -u -r1.66 mpm_common.c
--- server/mpm_common.c	2001/09/14 23:28:41	1.66
+++ server/mpm_common.c	2001/09/17 17:28:56
@@ -245,7 +245,7 @@
         switch (signum) {
         case SIGTERM:
         case SIGHUP:
-        case SIGWINCH:
+        case AP_RESTART_SIGNAL:
         case SIGKILL:
             break;
         default:
Index: server/protocol.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
retrieving revision 1.44
diff -u -r1.44 protocol.c
--- server/protocol.c	2001/09/11 18:38:21	1.44
+++ server/protocol.c	2001/09/17 17:28:59
@@ -406,17 +406,6 @@
     }
     /* we've probably got something to do, ignore graceful restart requests */
 
-    /* XXX - sigwait doesn't work if the signal has been SIG_IGNed (under
-     * linux 2.0 w/ glibc 2.0, anyway), and this step isn't necessary when
-     * we're running a sigwait thread anyway. If/when unthreaded mode is
-     * put back in, we should make sure to ignore this signal iff a sigwait
-     * thread isn't used. - mvsk
-
-#ifdef SIGWINCH
-    apr_signal(SIGWINCH, SIG_IGN);
-#endif
-    */
-
     r->request_time = apr_time_now();
     r->the_request = apr_pstrdup(r->pool, l);
     r->method = ap_getword_white(r->pool, &ll);
Index: server/mpm/beos/beos.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
retrieving revision 1.61
diff -u -r1.61 beos.c
--- server/mpm/beos/beos.c	2001/08/30 20:50:05	1.61
+++ server/mpm/beos/beos.c	2001/09/17 17:29:01
@@ -119,8 +119,8 @@
 
 /*
  * The max child slot ever assigned, preserved across restarts.  Necessary
- * to deal with MaxClients changes across SIGWINCH restarts.  We use this
- * value to optimize routines that have to scan the entire scoreboard.
+ * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We use 
+ * this value to optimize routines that have to scan the entire scoreboard.
  */
 int ap_max_child_assigned = -1;
 int ap_max_threads_limit = -1;
@@ -226,7 +226,7 @@
 
 static void restart(int sig)
 {
-    ap_start_restart(sig == SIGWINCH);
+    ap_start_restart(sig == AP_RESTART_SIGNAL);
 }
 
 static void tell_workers_to_exit(void)
@@ -270,14 +270,15 @@
     if (sigaction(SIGPIPE, &sa, NULL) < 0)
     	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
 
-    /* we want to ignore HUPs and WINCH while we're busy processing one */
+    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy 
+     * processing one */
     sigaddset(&sa.sa_mask, SIGHUP);
-    sigaddset(&sa.sa_mask, SIGWINCH);
+    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
     sa.sa_handler = restart;
     if (sigaction(SIGHUP, &sa, NULL) < 0)
     	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
-    if (sigaction(SIGWINCH, &sa, NULL) < 0)
-	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
+    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
+	    ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_RESTART_SIGNAL_STRING ")");
 }
 
 /*****************************************************************
@@ -810,9 +811,9 @@
 
     /* If we're doing a graceful_restart then we're going to see a lot
      * of threads exiting immediately when we get into the main loop
-     * below (because we just sent them SIGWINCH).  This happens pretty
-     * rapidly... and for each one that exits we'll start a new one until
-     * we reach at least threads_min_free.  But we may be permitted to
+     * below (because we just sent them AP_RESTART_SIGNAL).  This happens 
+     * pretty rapidly... and for each one that exits we'll start a new one 
+     * until we reach at least threads_min_free.  But we may be permitted to
      * start more than that, so we'll just keep track of how many we're
      * supposed to start up without the 1 second penalty between each fork.
      */
@@ -920,7 +921,7 @@
 
     if (is_graceful) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
-		    "SIGWINCH received.  Doing graceful restart");
+		    AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
     }
     else {
         /* Kill 'em all.  Since the child acts the same on the parents SIGTERM 
Index: server/mpm/perchild/perchild.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.78
diff -u -r1.78 perchild.c
--- server/mpm/perchild/perchild.c	2001/09/04 07:59:55	1.78
+++ server/mpm/perchild/perchild.c	2001/09/17 17:29:03
@@ -151,8 +151,9 @@
 
 /*
  * The max child slot ever assigned, preserved across restarts.  Necessary
- * to deal with NumServers changes across SIGWINCH restarts.  We use this
- * value to optimize routines that have to scan the entire child table.
+ * to deal with NumServers changes across AP_RESTART_SIGNAL restarts.  We 
+ * use this value to optimize routines that have to scan the entire child 
+ * table.
  *
  * XXX - It might not be worth keeping this code in. There aren't very
  * many child processes in this MPM.
@@ -352,7 +353,7 @@
 static void restart(int sig)
 {
 #ifndef WIN32
-    ap_start_restart(sig == SIGWINCH);
+    ap_start_restart(sig == AP_RESTART_SIGNAL);
 #else
     ap_start_restart(1);
 #endif
@@ -416,14 +417,15 @@
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
 #endif
 
-    /* we want to ignore HUPs and WINCH while we're busy processing one */
+    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy 
+     * processing one */
     sigaddset(&sa.sa_mask, SIGHUP);
-    sigaddset(&sa.sa_mask, SIGWINCH);
+    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
     sa.sa_handler = restart;
     if (sigaction(SIGHUP, &sa, NULL) < 0)
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
-    if (sigaction(SIGWINCH, &sa, NULL) < 0)
-	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
+    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
+	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_RESTART_SIGNAL_STRING ")");
 #else
     if (!one_process) {
 	apr_signal(SIGSEGV, sig_coredump);
@@ -451,9 +453,9 @@
 #ifdef SIGHUP
     apr_signal(SIGHUP, restart);
 #endif /* SIGHUP */
-#ifdef SIGWINCH
-    apr_signal(SIGWINCH, restart);
-#endif /* SIGWINCH */
+#ifdef AP_RESTART_SIGNAL
+    apr_signal(AP_RESTART_SIGNAL, restart);
+#endif /* AP_RESTART_SIGNAL */
 #ifdef SIGPIPE
     apr_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
@@ -1219,9 +1221,9 @@
 
     /* If we're doing a graceful_restart then we're going to see a lot
      * of children exiting immediately when we get into the main loop
-     * below (because we just sent them SIGWINCH).  This happens pretty
-     * rapidly... and for each one that exits we'll start a new one until
-     * we reach at least daemons_min_free.  But we may be permitted to
+     * below (because we just sent them AP_RESTART_SIGNAL).  This happens 
+     * pretty rapidly... and for each one that exits we'll start a new one 
+     * until we reach at least daemons_min_free.  But we may be permitted to
      * start more than that, so we'll just keep track of how many we're
      * supposed to start up without the 1 second penalty between each fork.
      */
@@ -1284,7 +1286,7 @@
         char char_of_death = '!';
 
 	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
-		    "SIGWINCH received.  Doing graceful restart");
+           AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
 
 	/* This is mostly for debugging... so that we know what is still
          * gracefully dealing with existing request.
Index: server/mpm/prefork/prefork.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
retrieving revision 1.200
diff -u -r1.200 prefork.c
--- server/mpm/prefork/prefork.c	2001/08/30 20:50:05	1.200
+++ server/mpm/prefork/prefork.c	2001/09/17 17:29:05
@@ -144,8 +144,8 @@
 
 /*
  * The max child slot ever assigned, preserved across restarts.  Necessary
- * to deal with MaxClients changes across SIGWINCH restarts.  We use this
- * value to optimize routines that have to scan the entire scoreboard.
+ * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We 
+ * use this value to optimize routines that have to scan the entire scoreboard.
  */
 int ap_max_daemons_limit = -1;
 server_rec *ap_server_conf;
@@ -435,7 +435,7 @@
     shutdown_pending = 1;
 }
 
-/* restart() is the signal handler for SIGHUP and SIGWINCH
+/* restart() is the signal handler for SIGHUP and AP_RESTART_SIGNAL
  * in the parent process, unless running in ONE_PROCESS mode
  */
 static void restart(int sig)
@@ -445,7 +445,7 @@
 	return;
     }
     restart_pending = 1;
-    if ((is_graceful = (sig == SIGWINCH))) {
+    if ((is_graceful = (sig == AP_RESTART_SIGNAL))) {
         apr_pool_cleanup_kill(pconf, NULL, ap_cleanup_scoreboard);
     }
 }
@@ -508,14 +508,15 @@
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
 #endif
 
-    /* we want to ignore HUPs and WINCH while we're busy processing one */
+    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy 
+     * processing one */
     sigaddset(&sa.sa_mask, SIGHUP);
-    sigaddset(&sa.sa_mask, SIGWINCH);
+    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
     sa.sa_handler = restart;
     if (sigaction(SIGHUP, &sa, NULL) < 0)
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
-    if (sigaction(SIGWINCH, &sa, NULL) < 0)
-        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
+    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
+        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_RESTART_SIGNAL_STRING ")");
 #else
     if (!one_process) {
 	apr_signal(SIGSEGV, sig_coredump);
@@ -543,9 +544,9 @@
 #ifdef SIGHUP
     apr_signal(SIGHUP, restart);
 #endif /* SIGHUP */
-#ifdef SIGWINCH
-    apr_signal(SIGWINCH, restart);
-#endif /* SIGWINCH */
+#ifdef AP_RESTART_SIGNAL
+    apr_signal(AP_RESTART_SIGNAL, restart);
+#endif /* AP_RESTART_SIGNAL */
 #ifdef SIGPIPE
     apr_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
@@ -856,7 +857,7 @@
 
     if (one_process) {
 	apr_signal(SIGHUP, just_die);
-        /* Don't catch SIGWINCH in ONE_PROCESS mode :) */
+        /* Don't catch AP_RESTART_SIGNAL in ONE_PROCESS mode :) */
 	apr_signal(SIGINT, just_die);
 #ifdef SIGQUIT
 	apr_signal(SIGQUIT, SIG_DFL);
@@ -909,10 +910,10 @@
 	 */
 	apr_signal(SIGHUP, just_die);
 	apr_signal(SIGTERM, just_die);
-        /* The child process doesn't do anything for SIGWINCH.  Instead, the
-         * pod is used for signalling graceful restart.
+        /* The child process doesn't do anything for AP_RESTART_SIGNAL.  
+         * Instead, the pod is used for signalling graceful restart.
          */
-        apr_signal(SIGWINCH, SIG_IGN);
+        apr_signal(AP_RESTART_SIGNAL, SIG_IGN);
 	child_main(slot);
     }
 
@@ -1141,7 +1142,7 @@
 
     /* If we're doing a graceful_restart then we're going to see a lot
 	* of children exiting immediately when we get into the main loop
-	* below (because we just sent them SIGWINCH).  This happens pretty
+	* below (because we just sent them AP_RESTART_SIGNAL).  This happens pretty
 	* rapidly... and for each one that exits we'll start a new one until
 	* we reach at least daemons_min_free.  But we may be permitted to
 	* start more than that, so we'll just keep track of how many we're
Index: server/mpm/threaded/threaded.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/threaded.c,v
retrieving revision 1.63
diff -u -r1.63 threaded.c
--- server/mpm/threaded/threaded.c	2001/08/30 20:50:06	1.63
+++ server/mpm/threaded/threaded.c	2001/09/17 17:29:09
@@ -134,8 +134,8 @@
 
 /*
  * The max child slot ever assigned, preserved across restarts.  Necessary
- * to deal with MaxClients changes across SIGWINCH restarts.  We use this
- * value to optimize routines that have to scan the entire scoreboard.
+ * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We use 
+ * this value to optimize routines that have to scan the entire scoreboard.
  */
 int ap_max_daemons_limit = -1;
 
@@ -332,7 +332,7 @@
 
 static void restart(int sig)
 {
-    ap_start_restart(sig == SIGWINCH);
+    ap_start_restart(sig == AP_RESTART_SIGNAL);
 }
 
 static void set_signals(void)
@@ -393,14 +393,15 @@
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
 #endif
 
-    /* we want to ignore HUPs and WINCH while we're busy processing one */
+    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy 
+     * processing one */
     sigaddset(&sa.sa_mask, SIGHUP);
-    sigaddset(&sa.sa_mask, SIGWINCH);
+    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
     sa.sa_handler = restart;
     if (sigaction(SIGHUP, &sa, NULL) < 0)
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
-    if (sigaction(SIGWINCH, &sa, NULL) < 0)
-	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
+    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
+	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_RESTART_SIGNAL_STRING ")");
 #else
     if (!one_process) {
 	apr_signal(SIGSEGV, sig_coredump);
@@ -428,9 +429,9 @@
 #ifdef SIGHUP
     apr_signal(SIGHUP, restart);
 #endif /* SIGHUP */
-#ifdef SIGWINCH
-    apr_signal(SIGWINCH, restart);
-#endif /* SIGWINCH */
+#ifdef AP_RESTART_SIGNAL
+    apr_signal(AP_RESTART_SIGNAL, restart);
+#endif /* AP_RESTART_SIGNAL */
 #ifdef SIGPIPE
     apr_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
@@ -1254,9 +1255,9 @@
 
     /* If we're doing a graceful_restart then we're going to see a lot
      * of children exiting immediately when we get into the main loop
-     * below (because we just sent them SIGWINCH).  This happens pretty
-     * rapidly... and for each one that exits we'll start a new one until
-     * we reach at least daemons_min_free.  But we may be permitted to
+     * below (because we just sent them AP_RESTART_SIGNAL).  This happens 
+     * pretty rapidly... and for each one that exits we'll start a new one 
+     * until we reach at least daemons_min_free.  But we may be permitted to
      * start more than that, so we'll just keep track of how many we're
      * supposed to start up without the 1 second penalty between each fork.
      */
@@ -1332,7 +1333,7 @@
     
     if (is_graceful) {
 	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
-		    "SIGWINCH received.  Doing graceful restart");
+		    AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
 
 	/* This is mostly for debugging... so that we know what is still
          * gracefully dealing with existing request.
Index: server/mpm/worker/worker.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
retrieving revision 1.21
diff -u -r1.21 worker.c
--- server/mpm/worker/worker.c	2001/08/30 20:50:06	1.21
+++ server/mpm/worker/worker.c	2001/09/17 17:29:12
@@ -143,8 +143,9 @@
 
 /*
  * The max child slot ever assigned, preserved across restarts.  Necessary
- * to deal with MaxClients changes across SIGWINCH restarts.  We use this
- * value to optimize routines that have to scan the entire scoreboard.
+ * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We 
+ * use this value to optimize routines that have to scan the entire 
+ * scoreboard.
  */
 int ap_max_daemons_limit = -1;
 
@@ -355,7 +356,7 @@
 
 static void restart(int sig)
 {
-    ap_start_restart(sig == SIGWINCH);
+    ap_start_restart(sig == AP_RESTART_SIGNAL);
 }
 
 static void set_signals(void)
@@ -416,14 +417,15 @@
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
 #endif
 
-    /* we want to ignore HUPs and WINCH while we're busy processing one */
+    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy 
+     * processing one */
     sigaddset(&sa.sa_mask, SIGHUP);
-    sigaddset(&sa.sa_mask, SIGWINCH);
+    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
     sa.sa_handler = restart;
     if (sigaction(SIGHUP, &sa, NULL) < 0)
 	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
-    if (sigaction(SIGWINCH, &sa, NULL) < 0)
-	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
+    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
+	ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(" AP_RESTART_SIGNAL_STRING ")");
 #else
     if (!one_process) {
 	apr_signal(SIGSEGV, sig_coredump);
@@ -451,9 +453,9 @@
 #ifdef SIGHUP
     apr_signal(SIGHUP, restart);
 #endif /* SIGHUP */
-#ifdef SIGWINCH
-    apr_signal(SIGWINCH, restart);
-#endif /* SIGWINCH */
+#ifdef AP_RESTART_SIGNAL
+    apr_signal(AP_RESTART_SIGNAL, restart);
+#endif /* AP_RESTART_SIGNAL */
 #ifdef SIGPIPE
     apr_signal(SIGPIPE, SIG_IGN);
 #endif /* SIGPIPE */
@@ -1335,7 +1337,7 @@
 
     /* If we're doing a graceful_restart then we're going to see a lot
      * of children exiting immediately when we get into the main loop
-     * below (because we just sent them SIGWINCH).  This happens pretty
+     * below (because we just sent them AP_RESTART_SIGNAL).  This happens pretty
      * rapidly... and for each one that exits we'll start a new one until
      * we reach at least daemons_min_free.  But we may be permitted to
      * start more than that, so we'll just keep track of how many we're
@@ -1413,7 +1415,7 @@
     
     if (is_graceful) {
 	ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
-		    "SIGWINCH received.  Doing graceful restart");
+		    AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
 
 	/* This is mostly for debugging... so that we know what is still
          * gracefully dealing with existing request.
Index: support/apachectl.in
===================================================================
RCS file: /home/cvs/httpd-2.0/support/apachectl.in,v
retrieving revision 1.3
diff -u -r1.3 apachectl.in
--- support/apachectl.in	2001/05/09 15:56:50	1.3
+++ support/apachectl.in	2001/09/17 17:29:14
@@ -125,7 +125,7 @@
 	    fi
 	else
 	    if $HTTPD -t >/dev/null 2>&1; then
-		if kill -WINCH $PID ; then
+		if kill -@AP_RESTART_SIGNAL@ $PID ; then
 		    echo "$0 $ARG: httpd gracefully restarted"
 		else
 		    echo "$0 $ARG: httpd could not be restarted"
@@ -161,7 +161,7 @@
              not running
 fullstatus - dump a full status screen; requires lynx and mod_status enabled
 status     - dump a short status screen; requires lynx and mod_status enabled
-graceful   - do a graceful restart by sending a SIGWINCH or start if not running
+graceful   - do a graceful restart by sending a @AP_RESTART_SIGNAL@ or start if not running
 configtest - do a configuration syntax test
 help       - this screen
 


Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Ryan Bloom wrote:
> 
> This is completely BOGUS! If I have a farm of web servers
> running on different platforms, all of the signals should
> be the same.

Oh, bah.  'Windows.'  'VMS.'  'MacOS' (not OS X).  I agree
with Sander that the thing that should be the same is the supported
commands to manipulate the server.  The details of implementation
have no need of being identical.  Although it *is* a nice-to-have',
I don't think it is anything more than that
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
On Tue, Sep 18, 2001 at 06:55:48AM -0700, Ryan Bloom wrote:
> As I said a LONG time ago.  I'm not veto'ing this change.  That doesn't
> mean I can't gripe about it.  I am sick and tired of going back and forth
> over issues that were decided years ago.

And I am sick and tired of hearing about things that were "decided"
years ago that were merely poorly informed changes made while fooling
around with an early threaded httpd.  These things will get fixed early
in the process if we can spend our time fixing them rather than arguing
about how long it has been in the code.  The only thing that matters is
which will be better for the people who actually use the software.

I understand why SIGWINCH was desired at that time.  What I didn't understand
was why it was still being used when we know SIGWINCH is not a good signal,
is not even implemented in some of our supported platforms, and conflicts
with all of the external documentation and control scripts for httpd.

I definitely agree that it is best to have it work consistently on all
platforms, but the only way we can do that is with the daemon option (-k ?)
that we currently use on win32.  That is how many other daemons have solved
this same problem on Unix.

....Roy


Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Ryan Bloom <rb...@covalent.net>.
On Tuesday 18 September 2001 01:58 am, Greg Stein wrote:

As I said a LONG time ago.  I'm not veto'ing this change.  That doesn't
mean I can't gripe about it.  I am sick and tired of going back and forth
over issues that were decided years ago.

Ryan

> On Mon, Sep 17, 2001 at 11:38:25PM -0700, Justin Erenkrantz wrote:
> >...
> > Since there is a veto against the use of SIGWINCH by default, the
> > current code in CVS is broken.  I would like to resolve this
> > before we tag and roll again.  -- justin
>
> By definition, it must be resolved before the next release. Of course, we
> could tag/roll, but release? nope :-)
>
> Personally, I'm in favor of tossing SIGWINCH, too. Kind of sucks to tell
> Apache to not detach from the terminal, and have it go wonky when I resize
> the bugger.
>
> Cheers,
> -g

-- 

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Sep 17, 2001 at 11:38:25PM -0700, Justin Erenkrantz wrote:
>...
> Since there is a veto against the use of SIGWINCH by default, the 
> current code in CVS is broken.  I would like to resolve this 
> before we tag and roll again.  -- justin

By definition, it must be resolved before the next release. Of course, we
could tag/roll, but release? nope :-)

Personally, I'm in favor of tossing SIGWINCH, too. Kind of sucks to tell
Apache to not detach from the terminal, and have it go wonky when I resize
the bugger.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Sep 17, 2001 at 11:23:14AM -0700, Ryan Bloom wrote:
> Forcing people to use SIGUSR1on a platform that has co-opted that signal
> is broken.

Obviously, that wouldn't work.  My patch allowed SIGWINCH to be used on 
Linux 2.0 while switching the default to be SIGUSR1 on sane platforms.

Your complaint is that the signal must be the same on all platforms.
Therefore, I ask what you would like to do (should this be a vote?):

[ ]  Enforce SIGUSR1 across all platforms and drop support for any 
     platform that does not allow SIGUSR1 to be used for graceful
     restart.
[ ]  Allow the default to be SIGUSR1, but on platforms on which
     SIGUSR1 is not viable, use an alternative signal (such as 
     SIGWINCH on Linux 2.0/glibc 2.0).  This would also allow the
     site admin to customize the signal at configure time.

Since there is a veto against the use of SIGWINCH by default, the 
current code in CVS is broken.  I would like to resolve this 
before we tag and roll again.  -- justin


Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 17 September 2001 11:15 am, Justin Erenkrantz wrote:
> On Mon, Sep 17, 2001 at 11:07:13AM -0700, Ryan Bloom wrote:
> > On Monday 17 September 2001 11:04 am, Justin Erenkrantz wrote:
> >
> > I know what the mails were about.  I am simply stating that it is still
> > completely bogus.
>
> I disagree.
>
> It should be SIGUSR1 everywhere.  As a compromise, I allowed configure
> to use SIGWINCH on Linux 2.0.  Would it make more sense to give a fatal
> error on that platform?  -- justin

Have you ever tried running a threaded app that uses SIGUSR1 on Linux 2.0?
It doesn't even start.  If you turn that into a fatal error, then you should be
prepared to answer all of the questions from Linux users about it.  If you really
think that you won't get any, take a look at what happened when we forced
Windows users to use WinSock2.

Forcing people to use SIGUSR1on a platform that has co-opted that signal
is broken.

Ryan

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Sep 17, 2001 at 11:07:13AM -0700, Ryan Bloom wrote:
> On Monday 17 September 2001 11:04 am, Justin Erenkrantz wrote:
> 
> I know what the mails were about.  I am simply stating that it is still completely
> bogus.

I disagree.

It should be SIGUSR1 everywhere.  As a compromise, I allowed configure
to use SIGWINCH on Linux 2.0.  Would it make more sense to give a fatal 
error on that platform?  -- justin


Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 17 September 2001 11:04 am, Justin Erenkrantz wrote:

I know what the mails were about.  I am simply stating that it is still completely
bogus.

Ryan

> On Mon, Sep 17, 2001 at 10:57:32AM -0700, Ryan Bloom wrote:
> > This is completely BOGUS! If I have a farm of web servers running on
> > different platforms, all of the signals should be the same.
>
> Roy's -1 on SIGWINCH:
>
> http://www.apachelabs.org/apache-mbox/200108.mbox/%3c20010830132250.A1832@w
>aka.ebuilt.net%3e
>
> Roy's comment on making it configurable:
>
> http://www.apachelabs.org/apache-mbox/200108.mbox/%3c20010830154010.B2142@w
>aka.ebuilt.net%3e
>
> -- justin
>
> P.S. He called it AP_SIG_GRACEFUL which is probably better than what I
> had.

-- 

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Sep 17, 2001 at 10:57:32AM -0700, Ryan Bloom wrote:
> This is completely BOGUS! If I have a farm of web servers running on different
> platforms, all of the signals should be the same.

Roy's -1 on SIGWINCH:

http://www.apachelabs.org/apache-mbox/200108.mbox/%3c20010830132250.A1832@waka.ebuilt.net%3e

Roy's comment on making it configurable:

http://www.apachelabs.org/apache-mbox/200108.mbox/%3c20010830154010.B2142@waka.ebuilt.net%3e

-- justin

P.S. He called it AP_SIG_GRACEFUL which is probably better than what I
had.


RE: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Sander Striker <st...@apache.org>.
> -----Original Message-----
> From: Ryan Bloom [mailto:rbb@covalent.net]
> Sent: 17 September 2001 19:58
> On Monday 17 September 2001 10:53 am, Justin Erenkrantz wrote:
> 
> This is completely BOGUS! If I have a farm of web servers running 
> on different
> platforms, all of the signals should be the same.

Can't we settle for 'the command on each machine to restart, stop,
etc. should be the same'? Ie. 
$ apachectl restart
$ apachectl stop

etc.

The alternatives are:

1) drop support linux kernel 2.0 with glibc 2.0
2) stick with SIGWINCH (which doesn't exist
   on some platform(s) IIRC).

Just my $0.02,

Sander

 
> Ryan
> 
> > This should resolve Roy's veto by switching back to SIGUSR1 for
> > graceful restarts (except on Linux 2.0 with glibc 2.0).
> >
> > As I don't think you can veto a veto (call a vote?), I don't think
> > his veto can be overriden.  But, I do want to post this before I
> > commit it as it is a widespread change and I may have missed
> > something.  We could extend this even further so that SIGHUP is
> > also defined as a #define, but I'm not terribly sure we want to
> > be that extreme.
> >
> > The docs also need to be updated, but I'm not sure the best way
> > to phrase that it is SIGUSR1 except on one incredibly old platform
> > that no one should be using threads with anyway.  -- justin
> 
> ______________________________________________________________
> Ryan Bloom				rbb@apache.org
> Covalent Technologies			rbb@covalent.net
> --------------------------------------------------------------
> 
> 
> 

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Ryan Bloom <rb...@covalent.net>.
On Monday 17 September 2001 10:53 am, Justin Erenkrantz wrote:

This is completely BOGUS! If I have a farm of web servers running on different
platforms, all of the signals should be the same.

Ryan

> This should resolve Roy's veto by switching back to SIGUSR1 for
> graceful restarts (except on Linux 2.0 with glibc 2.0).
>
> As I don't think you can veto a veto (call a vote?), I don't think
> his veto can be overriden.  But, I do want to post this before I
> commit it as it is a widespread change and I may have missed
> something.  We could extend this even further so that SIGHUP is
> also defined as a #define, but I'm not terribly sure we want to
> be that extreme.
>
> The docs also need to be updated, but I'm not sure the best way
> to phrase that it is SIGUSR1 except on one incredibly old platform
> that no one should be using threads with anyway.  -- justin

______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Aaron Bannert <aa...@clove.org>.
On Mon, Sep 17, 2001 at 02:01:40PM -0400, Rodent of Unusual Size wrote:
> > As I don't think you can veto a veto (call a vote?), I don't think
> > his veto can be overriden.
> 
> Nope; he has to be convinced to retract it. :-)

Maybe we should wait until he can speak for himself.

-aaron

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Justin Erenkrantz wrote:
> 
> This should resolve Roy's veto by switching back to SIGUSR1 for
> graceful restarts (except on Linux 2.0 with glibc 2.0).
> 
> As I don't think you can veto a veto (call a vote?), I don't think
> his veto can be overriden.

Nope; he has to be convinced to retract it. :-)
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0

Posted by Bill Stoddard <bi...@wstoddard.com>.
My opinion is that we should support this patch (in concept, not reviewed in detail) or
not support Linux 2.0 with glibc 2.0.

Bill

----- Original Message -----
From: "Justin Erenkrantz" <je...@ebuilt.com>
To: <de...@httpd.apache.org>
Sent: Monday, September 17, 2001 1:53 PM
Subject: [PATCH] Switch back to SIGUSR1 and use SIGWINCH on Linux 2.0


> This should resolve Roy's veto by switching back to SIGUSR1 for
> graceful restarts (except on Linux 2.0 with glibc 2.0).
>
> As I don't think you can veto a veto (call a vote?), I don't think
> his veto can be overriden.  But, I do want to post this before I
> commit it as it is a widespread change and I may have missed
> something.  We could extend this even further so that SIGHUP is
> also defined as a #define, but I'm not terribly sure we want to
> be that extreme.
>
> The docs also need to be updated, but I'm not sure the best way
> to phrase that it is SIGUSR1 except on one incredibly old platform
> that no one should be using threads with anyway.  -- justin
>
> Index: CHANGES
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/CHANGES,v
> retrieving revision 1.358
> diff -u -r1.358 CHANGES
> --- CHANGES 2001/09/06 23:58:29 1.358
> +++ CHANGES 2001/09/17 17:28:48
> @@ -1,5 +1,8 @@
>  Changes with Apache 2.0.26-dev
>
> +  *) Switch back to SIGUSR1 for graceful restarts on all platforms that
> +     support it.  [Justin Erenkrantz]
> +
>    *) Rewrite find_start_sequence to use a better search algorithm
>       to find the start tag.  [Justin Erenkrantz]
>
> Index: configure.in
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/configure.in,v
> retrieving revision 1.179
> diff -u -r1.179 configure.in
> --- configure.in 2001/09/15 11:44:55 1.179
> +++ configure.in 2001/09/17 17:28:48
> @@ -142,6 +142,8 @@
>  APACHE_SUBST(SHLTCFLAGS)
>  APACHE_SUBST(LTCFLAGS)
>
> +AP_RESTART_SIGNAL=SIGUSR1
> +
>  case $host in
>    *-apple-aux3*)
>        APR_SETVAR(APACHE_MPM, [prefork])
> @@ -157,7 +159,11 @@
>        ;;
>    *-linux-*)
>        case `uname -r` in
> -        2.[[2-9]]* ) APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
> +        2.0* )
> +            AP_RESTART_SIGNAL=SIGWINCH
> +            ;;
> +        2.[[2-9]]* )
> +            APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
>              ;;
>          * )
>              ;;
> @@ -346,6 +352,10 @@
>      AC_DEFINE(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, 1,
>                [This platform doesn't suffer from the thundering herd problem])
>  fi
> +
> +AC_DEFINE_UNQUOTED(AP_RESTART_SIGNAL, $AP_RESTART_SIGNAL, [Signal used to gracefully
restart])
> +AC_DEFINE_UNQUOTED(AP_RESTART_SIGNAL_STRING, "$AP_RESTART_SIGNAL", [Signal used to
gracefully restart (as a quoted string)])
> +AC_SUBST(AP_RESTART_SIGNAL)
>
>  dnl check for endianness
>  if test "$cross_compiling" = "no"; then
> Index: modules/generators/mod_cgid.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
> retrieving revision 1.97
> diff -u -r1.97 mod_cgid.c
> --- modules/generators/mod_cgid.c 2001/08/27 20:25:42 1.97
> +++ modules/generators/mod_cgid.c 2001/09/17 17:28:53
> @@ -238,10 +238,10 @@
>          case APR_OC_REASON_LOST:
>              /* it would be better to restart just the cgid child
>               * process but for now we'll gracefully restart the entire
> -             * server by sending SIGWINCH to ourself, the httpd parent
> -             * process
> +             * server by sending AP_RESTART_SIGNAL to ourself, the httpd
> +             * parent process
>               */
> -            kill(getpid(), SIGWINCH);
> +            kill(getpid(), AP_RESTART_SIGNAL);
>              break;
>          case APR_OC_REASON_RESTART:
>              apr_proc_other_child_unregister(data);
> Index: modules/mappers/mod_so.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_so.c,v
> retrieving revision 1.42
> diff -u -r1.42 mod_so.c
> --- modules/mappers/mod_so.c 2001/06/07 10:38:13 1.42
> +++ modules/mappers/mod_so.c 2001/09/17 17:28:53
> @@ -59,8 +59,8 @@
>  /*
>   * This module is used to load Apache modules at runtime. This means that the
>   * server functionality can be extended without recompiling and even without
> - * taking the server down at all. Only a HUP or WINCH signal needs to be send
> - * to the server to reload the dynamically loaded modules.
> + * taking the server down at all. Only a HUP or AP_RESTART_SIGNAL signal
> + * needs to be sent to the server to reload the dynamically loaded modules.
>   *
>   * To use, you'll first need to build your module as a shared library, then
>   * update your configuration (httpd.conf) to get the Apache core to load the
> @@ -98,9 +98,9 @@
>   * directive to get these log messages).
>   *
>   * If you edit the LoadModule directives while the server is live you can get
> - * Apache to re-load the modules by sending it a HUP or WINCH signal as normal.
> - * You can use this to dynamically change the capability of your server
> - * without bringing it down.
> + * Apache to re-load the modules by sending it a HUP or AP_RESTART_SIGNAL
> + * signal as normal.  You can use this to dynamically change the capability
> + * of your server without bringing it down.
>   *
>   * Because currently there is only limited builtin support in the Configure
>   * script for creating the shared library files (`.so'), please consult your
> Index: server/log.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/log.c,v
> retrieving revision 1.96
> diff -u -r1.96 log.c
> --- server/log.c 2001/07/30 17:55:38 1.96
> +++ server/log.c 2001/09/17 17:28:55
> @@ -527,7 +527,7 @@
>      mypid = getpid();
>      if (mypid != saved_pid
>           && apr_stat(&finfo, fname, APR_FINFO_MTIME, p) == APR_SUCCESS) {
> -      /* WINCH and HUP call this on each restart.
> +      /* AP_RESTART_SIGNAL and HUP call this on each restart.
>         * Only warn on first time through for this pid.
>         *
>         * XXX: Could just write first time through too, although
> Index: server/mpm_common.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
> retrieving revision 1.66
> diff -u -r1.66 mpm_common.c
> --- server/mpm_common.c 2001/09/14 23:28:41 1.66
> +++ server/mpm_common.c 2001/09/17 17:28:56
> @@ -245,7 +245,7 @@
>          switch (signum) {
>          case SIGTERM:
>          case SIGHUP:
> -        case SIGWINCH:
> +        case AP_RESTART_SIGNAL:
>          case SIGKILL:
>              break;
>          default:
> Index: server/protocol.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
> retrieving revision 1.44
> diff -u -r1.44 protocol.c
> --- server/protocol.c 2001/09/11 18:38:21 1.44
> +++ server/protocol.c 2001/09/17 17:28:59
> @@ -406,17 +406,6 @@
>      }
>      /* we've probably got something to do, ignore graceful restart requests */
>
> -    /* XXX - sigwait doesn't work if the signal has been SIG_IGNed (under
> -     * linux 2.0 w/ glibc 2.0, anyway), and this step isn't necessary when
> -     * we're running a sigwait thread anyway. If/when unthreaded mode is
> -     * put back in, we should make sure to ignore this signal iff a sigwait
> -     * thread isn't used. - mvsk
> -
> -#ifdef SIGWINCH
> -    apr_signal(SIGWINCH, SIG_IGN);
> -#endif
> -    */
> -
>      r->request_time = apr_time_now();
>      r->the_request = apr_pstrdup(r->pool, l);
>      r->method = ap_getword_white(r->pool, &ll);
> Index: server/mpm/beos/beos.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/beos/beos.c,v
> retrieving revision 1.61
> diff -u -r1.61 beos.c
> --- server/mpm/beos/beos.c 2001/08/30 20:50:05 1.61
> +++ server/mpm/beos/beos.c 2001/09/17 17:29:01
> @@ -119,8 +119,8 @@
>
>  /*
>   * The max child slot ever assigned, preserved across restarts.  Necessary
> - * to deal with MaxClients changes across SIGWINCH restarts.  We use this
> - * value to optimize routines that have to scan the entire scoreboard.
> + * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We use
> + * this value to optimize routines that have to scan the entire scoreboard.
>   */
>  int ap_max_child_assigned = -1;
>  int ap_max_threads_limit = -1;
> @@ -226,7 +226,7 @@
>
>  static void restart(int sig)
>  {
> -    ap_start_restart(sig == SIGWINCH);
> +    ap_start_restart(sig == AP_RESTART_SIGNAL);
>  }
>
>  static void tell_workers_to_exit(void)
> @@ -270,14 +270,15 @@
>      if (sigaction(SIGPIPE, &sa, NULL) < 0)
>      ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
"sigaction(SIGPIPE)");
>
> -    /* we want to ignore HUPs and WINCH while we're busy processing one */
> +    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy
> +     * processing one */
>      sigaddset(&sa.sa_mask, SIGHUP);
> -    sigaddset(&sa.sa_mask, SIGWINCH);
> +    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
>      sa.sa_handler = restart;
>      if (sigaction(SIGHUP, &sa, NULL) < 0)
>      ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
"sigaction(SIGHUP)");
> -    if (sigaction(SIGWINCH, &sa, NULL) < 0)
> -     ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
"sigaction(SIGWINCH)");
> +    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
> +     ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction("
AP_RESTART_SIGNAL_STRING ")");
>  }
>
>  /*****************************************************************
> @@ -810,9 +811,9 @@
>
>      /* If we're doing a graceful_restart then we're going to see a lot
>       * of threads exiting immediately when we get into the main loop
> -     * below (because we just sent them SIGWINCH).  This happens pretty
> -     * rapidly... and for each one that exits we'll start a new one until
> -     * we reach at least threads_min_free.  But we may be permitted to
> +     * below (because we just sent them AP_RESTART_SIGNAL).  This happens
> +     * pretty rapidly... and for each one that exits we'll start a new one
> +     * until we reach at least threads_min_free.  But we may be permitted to
>       * start more than that, so we'll just keep track of how many we're
>       * supposed to start up without the 1 second penalty between each fork.
>       */
> @@ -920,7 +921,7 @@
>
>      if (is_graceful) {
>          ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
> -     "SIGWINCH received.  Doing graceful restart");
> +     AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
>      }
>      else {
>          /* Kill 'em all.  Since the child acts the same on the parents SIGTERM
> Index: server/mpm/perchild/perchild.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
> retrieving revision 1.78
> diff -u -r1.78 perchild.c
> --- server/mpm/perchild/perchild.c 2001/09/04 07:59:55 1.78
> +++ server/mpm/perchild/perchild.c 2001/09/17 17:29:03
> @@ -151,8 +151,9 @@
>
>  /*
>   * The max child slot ever assigned, preserved across restarts.  Necessary
> - * to deal with NumServers changes across SIGWINCH restarts.  We use this
> - * value to optimize routines that have to scan the entire child table.
> + * to deal with NumServers changes across AP_RESTART_SIGNAL restarts.  We
> + * use this value to optimize routines that have to scan the entire child
> + * table.
>   *
>   * XXX - It might not be worth keeping this code in. There aren't very
>   * many child processes in this MPM.
> @@ -352,7 +353,7 @@
>  static void restart(int sig)
>  {
>  #ifndef WIN32
> -    ap_start_restart(sig == SIGWINCH);
> +    ap_start_restart(sig == AP_RESTART_SIGNAL);
>  #else
>      ap_start_restart(1);
>  #endif
> @@ -416,14 +417,15 @@
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
>  #endif
>
> -    /* we want to ignore HUPs and WINCH while we're busy processing one */
> +    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy
> +     * processing one */
>      sigaddset(&sa.sa_mask, SIGHUP);
> -    sigaddset(&sa.sa_mask, SIGWINCH);
> +    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
>      sa.sa_handler = restart;
>      if (sigaction(SIGHUP, &sa, NULL) < 0)
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
> -    if (sigaction(SIGWINCH, &sa, NULL) < 0)
> - ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
> +    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
> + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction("
AP_RESTART_SIGNAL_STRING ")");
>  #else
>      if (!one_process) {
>   apr_signal(SIGSEGV, sig_coredump);
> @@ -451,9 +453,9 @@
>  #ifdef SIGHUP
>      apr_signal(SIGHUP, restart);
>  #endif /* SIGHUP */
> -#ifdef SIGWINCH
> -    apr_signal(SIGWINCH, restart);
> -#endif /* SIGWINCH */
> +#ifdef AP_RESTART_SIGNAL
> +    apr_signal(AP_RESTART_SIGNAL, restart);
> +#endif /* AP_RESTART_SIGNAL */
>  #ifdef SIGPIPE
>      apr_signal(SIGPIPE, SIG_IGN);
>  #endif /* SIGPIPE */
> @@ -1219,9 +1221,9 @@
>
>      /* If we're doing a graceful_restart then we're going to see a lot
>       * of children exiting immediately when we get into the main loop
> -     * below (because we just sent them SIGWINCH).  This happens pretty
> -     * rapidly... and for each one that exits we'll start a new one until
> -     * we reach at least daemons_min_free.  But we may be permitted to
> +     * below (because we just sent them AP_RESTART_SIGNAL).  This happens
> +     * pretty rapidly... and for each one that exits we'll start a new one
> +     * until we reach at least daemons_min_free.  But we may be permitted to
>       * start more than that, so we'll just keep track of how many we're
>       * supposed to start up without the 1 second penalty between each fork.
>       */
> @@ -1284,7 +1286,7 @@
>          char char_of_death = '!';
>
>   ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
> -     "SIGWINCH received.  Doing graceful restart");
> +           AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
>
>   /* This is mostly for debugging... so that we know what is still
>           * gracefully dealing with existing request.
> Index: server/mpm/prefork/prefork.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
> retrieving revision 1.200
> diff -u -r1.200 prefork.c
> --- server/mpm/prefork/prefork.c 2001/08/30 20:50:05 1.200
> +++ server/mpm/prefork/prefork.c 2001/09/17 17:29:05
> @@ -144,8 +144,8 @@
>
>  /*
>   * The max child slot ever assigned, preserved across restarts.  Necessary
> - * to deal with MaxClients changes across SIGWINCH restarts.  We use this
> - * value to optimize routines that have to scan the entire scoreboard.
> + * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We
> + * use this value to optimize routines that have to scan the entire scoreboard.
>   */
>  int ap_max_daemons_limit = -1;
>  server_rec *ap_server_conf;
> @@ -435,7 +435,7 @@
>      shutdown_pending = 1;
>  }
>
> -/* restart() is the signal handler for SIGHUP and SIGWINCH
> +/* restart() is the signal handler for SIGHUP and AP_RESTART_SIGNAL
>   * in the parent process, unless running in ONE_PROCESS mode
>   */
>  static void restart(int sig)
> @@ -445,7 +445,7 @@
>   return;
>      }
>      restart_pending = 1;
> -    if ((is_graceful = (sig == SIGWINCH))) {
> +    if ((is_graceful = (sig == AP_RESTART_SIGNAL))) {
>          apr_pool_cleanup_kill(pconf, NULL, ap_cleanup_scoreboard);
>      }
>  }
> @@ -508,14 +508,15 @@
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
>  #endif
>
> -    /* we want to ignore HUPs and WINCH while we're busy processing one */
> +    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy
> +     * processing one */
>      sigaddset(&sa.sa_mask, SIGHUP);
> -    sigaddset(&sa.sa_mask, SIGWINCH);
> +    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
>      sa.sa_handler = restart;
>      if (sigaction(SIGHUP, &sa, NULL) < 0)
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
> -    if (sigaction(SIGWINCH, &sa, NULL) < 0)
> -        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
"sigaction(SIGWINCH)");
> +    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
> +        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction("
AP_RESTART_SIGNAL_STRING ")");
>  #else
>      if (!one_process) {
>   apr_signal(SIGSEGV, sig_coredump);
> @@ -543,9 +544,9 @@
>  #ifdef SIGHUP
>      apr_signal(SIGHUP, restart);
>  #endif /* SIGHUP */
> -#ifdef SIGWINCH
> -    apr_signal(SIGWINCH, restart);
> -#endif /* SIGWINCH */
> +#ifdef AP_RESTART_SIGNAL
> +    apr_signal(AP_RESTART_SIGNAL, restart);
> +#endif /* AP_RESTART_SIGNAL */
>  #ifdef SIGPIPE
>      apr_signal(SIGPIPE, SIG_IGN);
>  #endif /* SIGPIPE */
> @@ -856,7 +857,7 @@
>
>      if (one_process) {
>   apr_signal(SIGHUP, just_die);
> -        /* Don't catch SIGWINCH in ONE_PROCESS mode :) */
> +        /* Don't catch AP_RESTART_SIGNAL in ONE_PROCESS mode :) */
>   apr_signal(SIGINT, just_die);
>  #ifdef SIGQUIT
>   apr_signal(SIGQUIT, SIG_DFL);
> @@ -909,10 +910,10 @@
>   */
>   apr_signal(SIGHUP, just_die);
>   apr_signal(SIGTERM, just_die);
> -        /* The child process doesn't do anything for SIGWINCH.  Instead, the
> -         * pod is used for signalling graceful restart.
> +        /* The child process doesn't do anything for AP_RESTART_SIGNAL.
> +         * Instead, the pod is used for signalling graceful restart.
>           */
> -        apr_signal(SIGWINCH, SIG_IGN);
> +        apr_signal(AP_RESTART_SIGNAL, SIG_IGN);
>   child_main(slot);
>      }
>
> @@ -1141,7 +1142,7 @@
>
>      /* If we're doing a graceful_restart then we're going to see a lot
>   * of children exiting immediately when we get into the main loop
> - * below (because we just sent them SIGWINCH).  This happens pretty
> + * below (because we just sent them AP_RESTART_SIGNAL).  This happens pretty
>   * rapidly... and for each one that exits we'll start a new one until
>   * we reach at least daemons_min_free.  But we may be permitted to
>   * start more than that, so we'll just keep track of how many we're
> Index: server/mpm/threaded/threaded.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/threaded/threaded.c,v
> retrieving revision 1.63
> diff -u -r1.63 threaded.c
> --- server/mpm/threaded/threaded.c 2001/08/30 20:50:06 1.63
> +++ server/mpm/threaded/threaded.c 2001/09/17 17:29:09
> @@ -134,8 +134,8 @@
>
>  /*
>   * The max child slot ever assigned, preserved across restarts.  Necessary
> - * to deal with MaxClients changes across SIGWINCH restarts.  We use this
> - * value to optimize routines that have to scan the entire scoreboard.
> + * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We use
> + * this value to optimize routines that have to scan the entire scoreboard.
>   */
>  int ap_max_daemons_limit = -1;
>
> @@ -332,7 +332,7 @@
>
>  static void restart(int sig)
>  {
> -    ap_start_restart(sig == SIGWINCH);
> +    ap_start_restart(sig == AP_RESTART_SIGNAL);
>  }
>
>  static void set_signals(void)
> @@ -393,14 +393,15 @@
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
>  #endif
>
> -    /* we want to ignore HUPs and WINCH while we're busy processing one */
> +    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy
> +     * processing one */
>      sigaddset(&sa.sa_mask, SIGHUP);
> -    sigaddset(&sa.sa_mask, SIGWINCH);
> +    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
>      sa.sa_handler = restart;
>      if (sigaction(SIGHUP, &sa, NULL) < 0)
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
> -    if (sigaction(SIGWINCH, &sa, NULL) < 0)
> - ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
> +    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
> + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction("
AP_RESTART_SIGNAL_STRING ")");
>  #else
>      if (!one_process) {
>   apr_signal(SIGSEGV, sig_coredump);
> @@ -428,9 +429,9 @@
>  #ifdef SIGHUP
>      apr_signal(SIGHUP, restart);
>  #endif /* SIGHUP */
> -#ifdef SIGWINCH
> -    apr_signal(SIGWINCH, restart);
> -#endif /* SIGWINCH */
> +#ifdef AP_RESTART_SIGNAL
> +    apr_signal(AP_RESTART_SIGNAL, restart);
> +#endif /* AP_RESTART_SIGNAL */
>  #ifdef SIGPIPE
>      apr_signal(SIGPIPE, SIG_IGN);
>  #endif /* SIGPIPE */
> @@ -1254,9 +1255,9 @@
>
>      /* If we're doing a graceful_restart then we're going to see a lot
>       * of children exiting immediately when we get into the main loop
> -     * below (because we just sent them SIGWINCH).  This happens pretty
> -     * rapidly... and for each one that exits we'll start a new one until
> -     * we reach at least daemons_min_free.  But we may be permitted to
> +     * below (because we just sent them AP_RESTART_SIGNAL).  This happens
> +     * pretty rapidly... and for each one that exits we'll start a new one
> +     * until we reach at least daemons_min_free.  But we may be permitted to
>       * start more than that, so we'll just keep track of how many we're
>       * supposed to start up without the 1 second penalty between each fork.
>       */
> @@ -1332,7 +1333,7 @@
>
>      if (is_graceful) {
>   ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
> -     "SIGWINCH received.  Doing graceful restart");
> +     AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
>
>   /* This is mostly for debugging... so that we know what is still
>           * gracefully dealing with existing request.
> Index: server/mpm/worker/worker.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
> retrieving revision 1.21
> diff -u -r1.21 worker.c
> --- server/mpm/worker/worker.c 2001/08/30 20:50:06 1.21
> +++ server/mpm/worker/worker.c 2001/09/17 17:29:12
> @@ -143,8 +143,9 @@
>
>  /*
>   * The max child slot ever assigned, preserved across restarts.  Necessary
> - * to deal with MaxClients changes across SIGWINCH restarts.  We use this
> - * value to optimize routines that have to scan the entire scoreboard.
> + * to deal with MaxClients changes across AP_RESTART_SIGNAL restarts.  We
> + * use this value to optimize routines that have to scan the entire
> + * scoreboard.
>   */
>  int ap_max_daemons_limit = -1;
>
> @@ -355,7 +356,7 @@
>
>  static void restart(int sig)
>  {
> -    ap_start_restart(sig == SIGWINCH);
> +    ap_start_restart(sig == AP_RESTART_SIGNAL);
>  }
>
>  static void set_signals(void)
> @@ -416,14 +417,15 @@
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)");
>  #endif
>
> -    /* we want to ignore HUPs and WINCH while we're busy processing one */
> +    /* we want to ignore HUPs and AP_RESTART_SIGNAL while we're busy
> +     * processing one */
>      sigaddset(&sa.sa_mask, SIGHUP);
> -    sigaddset(&sa.sa_mask, SIGWINCH);
> +    sigaddset(&sa.sa_mask, AP_RESTART_SIGNAL);
>      sa.sa_handler = restart;
>      if (sigaction(SIGHUP, &sa, NULL) < 0)
>   ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGHUP)");
> -    if (sigaction(SIGWINCH, &sa, NULL) < 0)
> - ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGWINCH)");
> +    if (sigaction(AP_RESTART_SIGNAL, &sa, NULL) < 0)
> + ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction("
AP_RESTART_SIGNAL_STRING ")");
>  #else
>      if (!one_process) {
>   apr_signal(SIGSEGV, sig_coredump);
> @@ -451,9 +453,9 @@
>  #ifdef SIGHUP
>      apr_signal(SIGHUP, restart);
>  #endif /* SIGHUP */
> -#ifdef SIGWINCH
> -    apr_signal(SIGWINCH, restart);
> -#endif /* SIGWINCH */
> +#ifdef AP_RESTART_SIGNAL
> +    apr_signal(AP_RESTART_SIGNAL, restart);
> +#endif /* AP_RESTART_SIGNAL */
>  #ifdef SIGPIPE
>      apr_signal(SIGPIPE, SIG_IGN);
>  #endif /* SIGPIPE */
> @@ -1335,7 +1337,7 @@
>
>      /* If we're doing a graceful_restart then we're going to see a lot
>       * of children exiting immediately when we get into the main loop
> -     * below (because we just sent them SIGWINCH).  This happens pretty
> +     * below (because we just sent them AP_RESTART_SIGNAL).  This happens pretty
>       * rapidly... and for each one that exits we'll start a new one until
>       * we reach at least daemons_min_free.  But we may be permitted to
>       * start more than that, so we'll just keep track of how many we're
> @@ -1413,7 +1415,7 @@
>
>      if (is_graceful) {
>   ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, ap_server_conf,
> -     "SIGWINCH received.  Doing graceful restart");
> +     AP_RESTART_SIGNAL_STRING " received.  Doing graceful restart");
>
>   /* This is mostly for debugging... so that we know what is still
>           * gracefully dealing with existing request.
> Index: support/apachectl.in
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/support/apachectl.in,v
> retrieving revision 1.3
> diff -u -r1.3 apachectl.in
> --- support/apachectl.in 2001/05/09 15:56:50 1.3
> +++ support/apachectl.in 2001/09/17 17:29:14
> @@ -125,7 +125,7 @@
>       fi
>   else
>       if $HTTPD -t >/dev/null 2>&1; then
> - if kill -WINCH $PID ; then
> + if kill -@AP_RESTART_SIGNAL@ $PID ; then
>       echo "$0 $ARG: httpd gracefully restarted"
>   else
>       echo "$0 $ARG: httpd could not be restarted"
> @@ -161,7 +161,7 @@
>               not running
>  fullstatus - dump a full status screen; requires lynx and mod_status enabled
>  status     - dump a short status screen; requires lynx and mod_status enabled
> -graceful   - do a graceful restart by sending a SIGWINCH or start if not running
> +graceful   - do a graceful restart by sending a @AP_RESTART_SIGNAL@ or start if not
running
>  configtest - do a configuration syntax test
>  help       - this screen
>
>