Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a simple temporary file module that creates a unqiue temporary directory and then creates the temporary files inside. I used and END block to make sure the files where deleted when the script ended or died.
The problem is that it some cases, the END block is not executed and the files remain. When this first happened, I realized it was a result of the user stopping the http connection. A TERM or PIPE signal is sent to the cgi process.
I started installing signal handlers to catch the signals.
This has not completely solved the problem. In some cases, the http connection times out. The cgi process ends, but the END block in the temporary module is not executed. I tried installing signal handlers for all signals, but it did not help.
Does anyone know what happens to a cgi process when the http connection times-out? The web server in Apache on Linux.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI Perl Script fails to clean-up
by lhoward (Vicar) on May 23, 2000 at 06:17 UTC | |
by KM (Priest) on May 23, 2000 at 06:27 UTC |