Hi and thank you. I want to create a script that is activated when someone visits a .shtml page. That script is launched by a server side includes line.
The script need to check if a database was updated, and send mail to more email addresses about this. This mailing process might take a long time, and I don't want the page visitor to need waiting until the mailing is complete. The server is not mine and I can't use other methods to check the database from time to time and send mail, so the visitor is not interested in sending those emails at all. They don't even know that a mailing process is started by them. So I don't need to get the results from the child process. If I need this, I might print the results to a log file. I want the child process to continue working and the web page to finish loading after initiating the process, not waiting for it. I also want the child process to terminate fine without creating zombies. It is pretty hard to understand zombies very well, because I don't know Unix too well. Thank you. Teddy's Center for the blind: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] ----- Original Message ----- From: "zentara" <[EMAIL PROTECTED]> To: "Octavian Rasnita" <[EMAIL PROTECTED]> Sent: Wednesday, October 09, 2002 2:22 PM Subject: Re: How to run a process in background? On Wed, 9 Oct 2002 18:10:42 +0200 "Octavian Rasnita" <[EMAIL PROTECTED]> wrote: >I've tried the script sample and it works fine but it doesn't work with the >following line: >fork && exit; > >I need to type just: >fork; > >... because otherwise the browser (IE) keeps "Opening page...". The script was just to demonstrate what closing STDOUT does to release the browser. >Can you tell me, is it OK if I use the script with the line for closing >STDIN, STDOUT, and STDERR uncommented? Sure, but your browser will stay connected as long as the child process is running, or the server times out. Wasn't that your original problem? > >In this case all works fine. Is it any danger to create zombies? Zombies could get created if you kill off the parents before the children. >And what do you recommend, to use exec, or system? What are you trying to do exactly? system runs and returns results to the calling process, when you do an exec, the calling process terminates and the exec'd process goes on. >I don't need to get the output from the child process, but I don't know how >is better, to let the parent process to wait for the child, or not. If you don't need output from the child process, what is the child process doing? There is alot of intricacies with forking, and I can't say what you should do without know what you want to do. It would be best for you to post your code to the list, many brains are better than one. Post what you are trying to do, not just generalized questions about forking in a cgi. -- use Perl; #powerful programmable prestidigitation -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]