snafu has asked for the wisdom of the Perl Monks concerning the following question:
My current forking code...
----------## Should this program daemonize... ## ie: should it run all the time ## in the background? my $daemonize = 1; ################################################## # fork code if ( $daemonize ) { my $pid = fork(); die("fork() failed: $!") unless defined $pid; ## need to do something right here ## to get STDOUT and STDERR to go ## to a file vs the console/screen. if ($pid) { exit(0); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Messin around with fork() and fd's
by chromatic (Archbishop) on Oct 29, 2001 at 00:51 UTC | |
|
Re: Messin around with fork() and fd's
by wog (Curate) on Oct 29, 2001 at 00:49 UTC | |
|
Re: Messin around with fork() and fd's
by Zaxo (Archbishop) on Oct 29, 2001 at 07:17 UTC |