This relates to the relationship of a web server and it's child CGI process. As the parent process, the web server launches the CGI child process with the child's stdout directed to a file descriptor on the web server that is open for reading. The web server wants to swallow all of the output from the child process, so it waits for the file descriptor to reach eof(), which normally doesn't happen until the child process terminates. This is all consistent with the behavior you are reporting.
In order for the web server to see eof() on it's child's output, you will need to coerce the child process to close it's stdout stream. For most applications, this is not possible, since the application simply isn't written with that scenario in mind. The solution, then, is probably to launch an intermediate CGI that can launch the tar process, but can also close it's standard output, so the web server can return a page to the client browser, and stop waiting for the child to complete.
Last edited by theNbomr; 09-16-2012 at 11:48 AM.