On Sun, Jun 01, 2003 at 09:43:13PM +0100, Alex Hudson wrote:
> On Sun, Jun 01, 2003 at 09:18:26PM +0100, Lusercop wrote:
> > How is that even remotely the same? In the first case, you end up with no
> > zombies, in the second case you end up with a load of them?
> Hmm, unless I'm missing something, I'm agreeing with Toby. Brief testing
> on 2.4.20 says that setting SIGCHILD to IGNORE will prevent zombies 
> appearing; I guess it's like vampies and garlic. The man page also 
> indicates that the expected behaviour is that no zombies appear.

>From Camel, edition 3, p.415:
 "On many but not all kernels, a simple hack for autoreaping zombies is to
  set $SIG{CHLD} to 'ignore'."

This sounds like it ought to be a portability nightmare, but on a quick
test of FreeBSD 4.8 and Solaris 8, you appear to be correct. This seems
like the wrong behaviour to me, but what do I know.

> Given the process ids are sequential in my little test program, it's not
> Perl doing some daemonlike double-fork(), so I guess some special flag
> gets set somewhere or something.. dunno ;) I didn't think this 
> behaviour existed either, but it seems to. Try it.

No, as stated above it's a kernel hack, but I don't know where it got
propagated. It seems wrong to me that the kernel should do this, but
hey. As stated, my test case works on Linux, FreeBSD and Solaris. I
have to admit that I'm wrong, but I think that's a horrible bit of
behaviour, I think I would prefer to see a proper signal handler in
production.

-- 
Lusercop.net - LARTing Lusers everywhere since 2002

Reply via email to