Cagao has asked for the wisdom of the Perl Monks concerning the following question:
my $pid = fork; if ( ! defined $pid ) { # fork failed throw_invalid "Couldn't fork"; } elsif ( $pid > 0 ) { # parent exit; } else { while ( 1 ) { sleep 1; # and do other snazzy stuff forever } }
$ ps -ef rbrown 29884 3162 0 11:58 ? 00:00:00 crond rbrown 29885 29884 2 11:58 ? 00:00:03 solr-job-queue- <defunct> rbrown 29886 1 2 11:58 ? 00:00:02 /usr/bin/perl -w /home/me/solr-job-queue-process.plIs it all because the parent can't die until it's child has, and that's why cron isn't clearing it from the process table?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: daemon/fork: defunct parent not going away nicely
by dave_the_m (Monsignor) on Oct 14, 2011 at 11:28 UTC | |
by Eliya (Vicar) on Oct 14, 2011 at 11:55 UTC | |
by Cagao (Monk) on Oct 14, 2011 at 13:26 UTC | |
by Cagao (Monk) on Oct 14, 2011 at 11:39 UTC | |
|
Re: daemon/fork: defunct parent not going away nicely
by Your Mother (Archbishop) on Oct 14, 2011 at 13:30 UTC | |
|
Re: daemon/fork: defunct parent not going away nicely
by Anonymous Monk on Oct 14, 2011 at 11:13 UTC | |
by Cagao (Monk) on Oct 14, 2011 at 11:15 UTC |