By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,095 Members | 1,586 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,095 IT Pros & Developers. It's quick & easy.

Get cgi script to begin execution of another script...

P: n/a
I've posted something similar to this already, but now I'm more sure
of what I'm asking.

Basically I've a CGI script, that when executed by the user, I want to
call another script that does a very long running task (10 hours +)
and print a message on the screen saying that the user will be emailed
on completion of the very long task. The script executing the very
long task will then email the user on completion.

So far I have something like this (leaving out the obvious)...

CGI script:

pid = subprocess.Popen(["python", "spawn.py"]).pid
print "Thanks you will be emailed on completion"
Spawn.py script:

doVeryLongCalc()
emailUser()
Basically the problem with this is that the cgi script page in the
browser keeps on acting as if its loading until the Spawn.py script is
finished executing. Somehow apache "knows" that the spawned process is
still running in the background. So I'm basically asking if I can
somehow spawn a script that will be completely independent of its
parent script? So Apache doesn't know its running and the page
finishes loading?

Thanks if anyone can help...
Mar 12 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
sophie_newbie <pa**********@gmail.comwrote:
>Basically I've a CGI script, that when executed by the user, I want to
call another script that does a very long running task (10 hours +)
and print a message on the screen saying that the user will be emailed
on completion of the very long task. The script executing the very
long task will then email the user on completion.
http://aspn.activestate.com/ASPN/Coo.../Recipe/278731
was helpful to me in solving this problem.

--
\S -- si***@chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
"Frankly I have no feelings towards penguins one way or the other"
-- Arthur C. Clarke
her nu becomež se bera eadward ofdun hlęddre heafdes bęce bump bump bump
Mar 13 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.