From: Jeff Trawick Date: Fri, 28 Jul 2000 18:15:21 +0000 (+0000) Subject: Use ap_note_subprocess() to register the mod_cgid daemon process for cleanup X-Git-Tag: APACHE_2_0_ALPHA_5~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3bb567248c33e7145f2dcb24bfd27d1d55c6c83;p=thirdparty%2Fapache%2Fhttpd.git Use ap_note_subprocess() to register the mod_cgid daemon process for cleanup so that it is killed at termination if it does not die when the parent gets SIGTERM. This change is to fix occasional problems where the process stays around. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85917 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index ffbf332f623..0d437bf863e 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -601,7 +601,7 @@ static int cgid_server(void *data) static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *main_server) { pid_t pid; - ap_proc_t ap_pid; + ap_proc_t *procnew; if (once_through > 0) { ap_create_pool(&pcgi, p); @@ -614,10 +614,12 @@ static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_re cgid_server(main_server); exit(-1); } + procnew = ap_pcalloc(p, sizeof(*procnew)); + procnew->pid = pid; + procnew->err = procnew->in = procnew->out = NULL; + ap_note_subprocess(p, procnew, kill_after_timeout); #if APR_HAS_OTHER_CHILD - ap_pid.pid = pid; - ap_pid.err = ap_pid.in = ap_pid.out = NULL; - ap_register_other_child(&ap_pid, cgid_maint, NULL, NULL, p); + ap_register_other_child(procnew, cgid_maint, NULL, NULL, p); #endif } else once_through++;