Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 23821 invoked by uid 500); 12 Jul 2002 03:00:00 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 23807 invoked from network); 12 Jul 2002 02:59:59 -0000 To: dev@httpd.apache.org Subject: [PATCH?] SSI by mod_cgid.c, child process becomes zombie. X-Mailer: Cue version 0.6 (020620-1817/sakane) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Message-Id: <20020712120027O.sakane@kame.net> Date: Fri, 12 Jul 2002 12:00:27 +0900 From: Shoichi Sakane X-Dispatcher: imput version 20000228(IM140) Lines: 41 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N when i get a html file including a line "", a child process of cgi daemon process in the server becomes zombie. i'm using FreeBSD4.6-RELEASE and apache-2.0.39. cgid_server() calls apr_signal(SIGCHLD, SIG_IGN), but it doesn't work at least in my environment. i might be misoperating, anyway the patch is attached in this mail. i haven't care about the porting issue. so if this patch needs to modify to be suitable for other platform. i'm sorry if this issue has been already discussed. thank you. *** mod_cgid-old.c Fri Jun 14 04:41:17 2002 --- mod_cgid.c Wed Jul 10 21:38:02 2002 *************** *** 514,520 **** --- 514,537 ---- apr_pool_create(&ptrans, pcgi); + #if 0 apr_signal(SIGCHLD, SIG_IGN); + #else + /* + * parent should ignore the signal from child + * OR parent process has to wait for child process. + */ + { + struct sigaction sa; + + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = NULL; + sa.sa_flags = SA_NOCLDWAIT; + sigemptyset(&sa.sa_mask); + sigaction(SIGCHLD, &sa, (struct sigaction *)0); + } + #endif + apr_signal(SIGHUP, daemon_signal_handler); if (unlink(sconf->sockname) < 0 && errno != ENOENT) {