in reply to Re: Proc::Daemon not detaching
in thread Proc::Daemon not detaching
If the problem is Apache's doing, then you should first get Apache out of your hair before you daemonize. That will prevent Apache from having replaced fork() or POSIX::setsid() or other shenanigans that I wouldn't put past them.
if( ! @ARGV ) { # CGI code here my $pid = CORE::fork(); die "Can't fork: $!\n" if ! defined $pid; exit # or return, or whatever makes most sense to finish CGI p +art if $pid; CORE::exec( 'perl', $0, 'daemon' ); die "Can't exec perl: $!\n"; } # Rest of code here
- tye
|
|---|