From 8dfff0a318cb8339228d203ec4a5ae39d0083086 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sat, 13 Dec 2003 19:09:00 +0000 Subject: [PATCH] change the way the cgid daemon restart logic determines whether or not the MPM is still running... now it works with prefork MPM too git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102046 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/mod_cgid.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index c4cd28d576c..6b5f5fd8f02 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -270,6 +270,8 @@ static char **create_argv(apr_pool_t *p, char *path, char *user, char *group, 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 @@ static void cgid_maint(int reason, void *data, apr_wait_t status) /* 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: -- 2.47.3