when i get a html file including a line "<!--#exec cmd="ls" -->",
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) {