httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/prefork prefork.c
Date Thu, 14 Jun 2001 14:07:10 GMT
trawick     01/06/14 07:07:10

  Modified:    server/mpm/prefork prefork.c
  Log:
  catch SIGWINCH in the parent process and set appropriate flags
  so that we write to the pod to tell the servers to go away
  
  Revision  Changes    Path
  1.182     +11 -3     httpd-2.0/server/mpm/prefork/prefork.c
  
  Index: prefork.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/prefork/prefork.c,v
  retrieving revision 1.181
  retrieving revision 1.182
  diff -u -r1.181 -r1.182
  --- prefork.c	2001/06/14 13:27:37	1.181
  +++ prefork.c	2001/06/14 14:07:07	1.182
  @@ -406,6 +406,9 @@
       shutdown_pending = 1;
   }
   
  +/* restart() is the signal handler for SIGHUP and SIGWINCH
  + * in the parent process, unless running in ONE_PROCESS mode
  + */
   static void restart(int sig)
   {
       if (restart_pending == 1) {
  @@ -413,11 +416,9 @@
   	return;
       }
       restart_pending = 1;
  -#if 0
       if ((is_graceful = (sig == SIGWINCH))) {
           apr_pool_cleanup_kill(pconf, NULL, ap_cleanup_scoreboard);
       }
  -#endif
   }
   
   static void set_signals(void)
  @@ -480,9 +481,12 @@
   
       /* we want to ignore HUPs and WINCH while we're busy processing one */
       sigaddset(&sa.sa_mask, SIGHUP);
  +    sigaddset(&sa.sa_mask, SIGWINCH);
       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)");
   #else
       if (!one_process) {
   	apr_signal(SIGSEGV, sig_coredump);
  @@ -511,7 +515,7 @@
       apr_signal(SIGHUP, restart);
   #endif /* SIGHUP */
   #ifdef SIGWINCH
  -    apr_signal(SIGWINCH, SIG_IGN);
  +    apr_signal(SIGWINCH, restart);
   #endif /* SIGWINCH */
   #ifdef SIGPIPE
       apr_signal(SIGPIPE, SIG_IGN);
  @@ -889,6 +893,10 @@
   	 */
   	apr_signal(SIGHUP, please_die_gracefully);
   	apr_signal(SIGTERM, just_die);
  +        /* The child process doesn't do anything for SIGWINCH.  Instead, the
  +         * pod is used for signalling graceful restart.
  +         */
  +        apr_signal(SIGWINCH, SIG_IGN);
           ap_scoreboard_image->parent[slot].process_status = SB_WORKING;
   	child_main(slot);
       }
  
  
  

Mime
View raw message