I
Ishmael
Ok, this may sound odd, but I would like to create a zombie process
intentionally. I've been reading the perldoc for perlipc and it seems
like an unhappy marriage between 'alarm' and 'system' should do the
trick, but I haven't been able to get it to work. Can someone give me
a simple (!) example of how to create a zombie (using the alarm/
system combo - or even better, using fork and exec)? Thanks for you
help!
By the way, here's what I've been trying (unsuccessfully):
eval {
local $SIG{ALRM} = sub {die "system call killed by alarm"};
alarm 1;
my $cmd = 'perl -e \'while(1) { print "bla\n"; sleep(1); }\'';
# my $cmd = "/bin/tcsh\nwhile 1\necho \"bla\\n\"\nend\n";
print $cmd, "\n";
system($cmd);
alarm 0;
};
intentionally. I've been reading the perldoc for perlipc and it seems
like an unhappy marriage between 'alarm' and 'system' should do the
trick, but I haven't been able to get it to work. Can someone give me
a simple (!) example of how to create a zombie (using the alarm/
system combo - or even better, using fork and exec)? Thanks for you
help!
By the way, here's what I've been trying (unsuccessfully):
eval {
local $SIG{ALRM} = sub {die "system call killed by alarm"};
alarm 1;
my $cmd = 'perl -e \'while(1) { print "bla\n"; sleep(1); }\'';
# my $cmd = "/bin/tcsh\nwhile 1\necho \"bla\\n\"\nend\n";
print $cmd, "\n";
system($cmd);
alarm 0;
};