On Tuesday 09 February 2010 14:21:57 Tosh Cooey wrote:
> use POSIX 'setsid';
if( fork ) { POSIX::_exit 0; CORE::exit 0 }
> chdir '/' or die "Can't chdir to /: $!";
>
simplest is to fork() another time to break the parent-child relationship.
Keep in mind that you make your service vulnerable if you simply fork off long
running processes.
What prevents a user from testing it:
ab -n 100000 -c 100 http://...
This will quite fast create a *lot* of processes.
I tend to use some kind of queue for such processing. But, of course, it
depends.
Torsten