Following a recent thread, I managed to put together a daemon that works, in the sense that it returns '0' while running an external process using 'exec()'
$SIG{CHLD}=sub { wait(); print "Child exited\n";}; $| = 1; exec("/usr/local/bin/monster", "-i$id", "$filePath$file") unless fork( +); return 0;
The only thing is, if I try to start ANOTHER run at the same time, before the first EXTERNAL process has finished, the 'run' button hangs UNTIL the first process has finished and the CHLD handler returns, and then it runs it. It's basically queuing requests.
Each request is made from an applet i designed that uses XML-RPC, and the daemon is in turn a SOAP::Lite XML-RPC daemon. I need to use this daemon to work as an application server, in the true sense of a server, so that it will be able to accept any request at any time, and immediately run the software.
bottom line is that the above code doesnt do this job, what should i do to make sure that it'll immediately run every request.
thanks
Sam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |