httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/main http_main.c
Date Mon, 21 Oct 2002 13:41:58 GMT
martin      2002/10/21 06:41:58

  Modified:    src/main http_main.c
  Log:
  When we detect a child exiting with APEXIT_CHILDFATAL in process_child_status(),
  we simply exit(). Remove the pid file too, because it makes no sense after
  the parent has terminated.
  I assume that a better strategy here would be to kill(getpid(), SIGTERM) to
  enforce a regular shutdown sequence, killing the other child processes too.
  At the moment, they might be left running and blocking the server socket.
  
  Revision  Changes    Path
  1.595     +8 -0      apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.594
  retrieving revision 1.595
  diff -u -r1.594 -r1.595
  --- http_main.c	1 Oct 2002 14:24:23 -0000	1.594
  +++ http_main.c	21 Oct 2002 13:41:57 -0000	1.595
  @@ -4980,6 +4980,14 @@
   	*/
       if ((WIFEXITED(status)) &&
   	WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  +        /* cleanup pid file -- it is useless after our exiting */
  +        const char *pidfile = NULL;
  +        pidfile = ap_server_root_relative (pconf, ap_pid_fname);
  +        if ( pidfile != NULL && unlink(pidfile) == 0)
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
  +                         server_conf,
  +                         "removed PID file %s (pid=%ld)",
  +                         pidfile, (long)getpid());
   	ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server_conf,
   			"Child %d returned a Fatal error... \n"
   			"Apache is exiting!",
  
  
  

Mime
View raw message