cgi script: background process keeping my script from finishing?
Posted on 2001-08-31
I'm writing a "web power switch" for a set of applications, such that authorized users can visit a web page, and start or stop the application without having to log in to the server.
However, the application takes a long time to start up, (so long, in fact, that a web query will time out if you wait for process to finish) so I tried to run it in the background:
system("mybigslowapp 2>&1 >/tmp/logfile &");
This appears to allow my script to continue, but the page never seems to "finish" (The browser seems to be "waiting" for something, then eventually spits out an error message, saying the request timed out. (The app _does_ start up correctly, its just the web page I'm having trouble with) I also have this same script kill the app, and it works fine.
Am I correct in assuming that, in my current config, "bigslowapp" will have to finish before my perl script will finish up? How can I do this so it just spawns bigslowapp, and doesn't wait?
...If the points seem low for this question, speak up, I've got more :)