Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Forking and/or spawning long running processes under ModPerl::Registry

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


tosh at 1200group

Feb 21, 2010, 3:11 PM

Post #1 of 1 (381 views)
Permalink
Forking and/or spawning long running processes under ModPerl::Registry

This worked for me and perhaps somebody else will find this useful
because I for sure could not find any simple vanilla starting points for
creating forks under mod_perl, but I did find a way to spawn processes
and not get zombies (actually I haven't tested this fully, but I'm
pretty sure).

##### website.pl
... website stuff ...
system('/path/to/my_looooooong.pl', @args);
... more stuff ...


##### my_looooooong.pl
#!/usr/bin/perl

use Proc::Daemon;
Proc::Daemon::Init;

for my $num (1..10) {
sleep 1;
}


Now that's right, all the above does is sleep for 10 seconds, but at
least it will sleep without zombies and won't hang up the browser
connection.

I hope one day this saves somebody weeks of futzing around. I also hope
it works the way I think it works.

Tosh

--
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.