scavanau at cisco
Mar 2, 2012, 7:21 AM
CGI-BIN Timeout Question w/ Python
I am trying to write a webpage wrapper for some scripts I have written
in python on my FreeBSD 9 machine.
When I do this on the command line
It works fine, although the script takes 8 full seconds to
run...(normal) when I do a:
proc = subprocess.Popen(['/usr/local/bin/python', 'tests.py'],
in a cgi-bin .py webpage the script seems to time out. There are no
errors in the log (/var/log/httpd-error.log). When I make a 'fake'
shorter version of the script that only takes a fraction of a second to
run (versus the full 8 second version) the subprocess.Popen command
works fine and returns the data fine to the web browser. Doing some
digging it looks like the cgi-bin timeout is default at 300 seconds
which I am nowhere near... I am not sure where to go at this point... I
was thinking of running this in the background so the script can
continue on using (&) and then checking afterwards for a results file or
something... but that seems like a crappy fix. Sorry to be so ambiguous
but I have no errors (just behavior) to work with and I think it's
probably an architecture problem with the way I am approaching this on
apache. I am open to any and all suggestions but unfortunately I can
switch off FreeBSD 9.
Cisco Global Certifications Team - IPv6