Yes, fork processes and don't wait on them in the parent.
#!/usr/bin/perl
fork or exit for 1..100;
<>;
| [reply] [d/l] |
note: forked processes should exit and parent cannot.
perl -e 'fork || exit for 1 .. shift; <>' 5
| [reply] [d/l] |
Of course, I was doing it right, but when perl exits, the Zombies disappears. So I was wrong. Thank you!
Any way of leaving the zombies after the parent exits?
| [reply] |
A “zombie” process is always the immediate child of the parent that created it, which exists only so that the parent can reap it and thus collect its final status. Many operating systems impose limits on the number of zombies that may exist, for very obvious (denial-of-service) reasons.
When a parent dies, leaving orphans behind, those orphans are immediately reaped by the init process.
Your monitoring tool doesn’t have to test the operating system, nor should it challenge it. You may need to verify that the tool does, in fact, detect whatever conditions you want it to detect, in whatever situations you need for it to be able to do so, but you should not need to “stress test” this case, and I recommend that it would be both unreliable and pointless to try.
| |
I represent The Society for Prevention of Cruelty to Zombies. Do you have enough human brains for your zombie creations to eat? A hungry zombie is a terrible thing.
| [reply] |