Do you know where your variables are? | |
PerlMonks |
Re: Fork parent process dies unexpectedlyby nothingmuch (Priest) |
on Nov 19, 2005 at 16:18 UTC ( [id://510114]=note: print w/replies, xml ) | Need Help?? |
Without reading the code...
The problem is probably the PIPE signal. On UNIX platforms, when you write to a file descriptor that is no longer writable (because the receiving end closed it), you get a SIGPIPE delivered to your program. This signal is there to inform you that you can no longer write to that file descriptor, and it's default behavior is to kill your program (no point in e.g. cat file | wc -l continuing to write to the pipe after wc has already died). In client/server applications this default behavior is no longer appropriate, because the server persists. BTW, there are many fantastic modules for writing daemons on the CPAN... Others have already posted them. Have a look! Update: oh... i forgot how to get around SIGPIPE: or
-nuffin zz zZ Z Z #!perl
In Section
Seekers of Perl Wisdom
|
|