Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 8015 invoked from network); 13 Dec 2003 19:09:02 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Dec 2003 19:09:02 -0000 Received: (qmail 69784 invoked by uid 500); 13 Dec 2003 19:08:52 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 69751 invoked by uid 500); 13 Dec 2003 19:08:52 -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 69738 invoked by uid 500); 13 Dec 2003 19:08:52 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 69734 invoked from network); 13 Dec 2003 19:08:52 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 13 Dec 2003 19:08:52 -0000 Received: (qmail 7994 invoked by uid 1121); 13 Dec 2003 19:09:00 -0000 Date: 13 Dec 2003 19:09:00 -0000 Message-ID: <20031213190900.7993.qmail@minotaur.apache.org> From: trawick@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/generators mod_cgid.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N trawick 2003/12/13 11:09:00 Modified: modules/generators mod_cgid.c Log: change the way the cgid daemon restart logic determines whether or not the MPM is still running... now it works with prefork MPM too Revision Changes Path 1.161 +13 -4 httpd-2.0/modules/generators/mod_cgid.c Index: mod_cgid.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v retrieving revision 1.160 retrieving revision 1.161 diff -u -r1.160 -r1.161 --- mod_cgid.c 16 Nov 2003 02:09:13 -0000 1.160 +++ mod_cgid.c 13 Dec 2003 19:09:00 -0000 1.161 @@ -270,6 +270,8 @@ static void cgid_maint(int reason, void *data, apr_wait_t status) { apr_proc_t *proc = data; + int mpm_state; + int stopping; switch (reason) { case APR_OC_REASON_DEATH: @@ -277,10 +279,17 @@ /* If apache is not terminating or restarting, * restart the cgid daemon */ - if (!ap_graceful_stop_signalled()) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "cgid daemon process died, restarting"); - cgid_start(root_pool, root_server, proc); + stopping = 1; /* if MPM doesn't support query, + * assume we shouldn't restart daemon + */ + if (ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state) == APR_SUCCESS && + mpm_state != AP_MPMQ_STOPPING) { + stopping = 0; + } + if (!stopping) { + ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, + "cgid daemon process died, restarting"); + cgid_start(root_pool, root_server, proc); } break; case APR_OC_REASON_RESTART: