in reply to system command not working after connection with cgi breaks

Try these two things:

1. Remove the fork && exit at the end of your script - you don't need it.

2. On all of your system() commands, redirect STDOUT to a file or /dev/null. This especially is important for commands executed in the background like the last one you perform just before exiting.

Without #2, the server will never finish sending the response to your browser, and this might be causing your browser to time-out the connection which might have something to do with your problem.

Replies are listed 'Best First'.
Re^2: system command not working after connection with cgi breaks
by advait (Beadle) on Jun 23, 2008 at 18:04 UTC
    Thank you for the reply. I have removed fork and exit and I am using close(STDOUT)
    still not working...facing same problem
      To elaborate, you should append " >/dev/null" to your system command strings (but in the last case insert it before the &).

      Here's some basics on I/O redirection: Standard Input and Output Redirection

      You're still having problems because you didn't do what you were asked to do. pc88mixer asked you to redirect stdout in the system call to something else, like /dev/null, so that the output was not 'attached' to the cgi process. Closing stdout in the perl script isn't the same thing.