Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 84624 invoked by uid 500); 21 Oct 2002 13:41:59 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 84613 invoked by uid 500); 21 Oct 2002 13:41:58 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 21 Oct 2002 13:41:58 -0000 Message-ID: <20021021134158.31360.qmail@icarus.apache.org> From: martin@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/main http_main.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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!",