Hi all,
I have run into a problem on Compaq Tru64 with cgi processes
being reaped when using with mpm worker.
I had always thought the signal(SIGCHLD,SIG_IGN) would always
cause child processes to quietly go away but....
After rooting around through the libc and kernel code I found
that many behaviors related to SIGCHLD and SIG_IGN are supported, but
which one is used depends on which compile flags are set (which trigger
different standards behavior, sysV or XPG4 for example). The default
behavior for SIGCHLD & SIG_IGN is *not* for the child to disappear.
The Tru64 prefered way to get the desired behavior is to use sigaction
and add the flag SA_NOCLDWAIT. Rather than play with compile flags
(like -DOPEN_SOURCE) and as apr is using sigaction anyway... I think a
small change to signal.c may be the least intrusive fix.
SA_NOCLDWAIT is supposed to be a XPG4/XSH4.2 standards thingie...
Lastly - this only affects mod_cgid.c in the current code base.
Dave Hill
*** srclib/apr/threadproc/unix/signals.c.orig Tue Apr 16 18:22:07 2002
--- srclib/apr/threadproc/unix/signals.c Wed Apr 17 10:03:48 2002
***************
*** 105,110 ****
--- 105,116 ----
#ifdef SA_INTERRUPT /* SunOS */
act.sa_flags |= SA_INTERRUPT;
#endif
+ #ifdef SA_NOCLDWAIT
+ /* this is required on Tru64 to cause child processes to
+ disapear gracefully - XPG4 compatible */
+ if((signo == SIGCHLD) && (func == SIG_IGN))
+ act.sa_flags |= SA_NOCLDWAIT;
+ #endif
if (sigaction(signo, &act, &oact) < 0)
return SIG_ERR;
return oact.sa_handler;
--
+---------------------oOO--(_)--OOo------------------------+
|Dave Hill (0 0) Unix Software Group |
|Mailstop: ZKO3-2/W17 \//\/ |
|Digital Equipment Corp. (603 )884-2985 |
|110 Spitbrook Road /\//\ enet: [EMAIL PROTECTED]|
|Nashua, NH 03062-2698 (0_0) |
+---------------------oOO--(_)--OOo------------------------+