Would it suffice, if in the program we want to run in the background, we do a fork, and then terminate the parent process, while the child process starts the services as required?
Regards,
Rajat
Manish K Arya wrote:
hi
thanks for quick reply.
actully have made a program that read mysql database in cartain time intervals and takes action according to cases.now i want to have a web based panel to start and stop that service.On Tue, 22 Jan 2002 11:33:43
Kapil Sethi wrote:
>I think that is an interesting situation.
>
>The job of HTTP server is to load a file and transfer the contents to the
>client. after the html page is served the server closes the connection. In
>case of server parsed documents like cgi / php /asp etc. scripts the server
>waits for the appropriate engine to process the request and hand over the
>document in HTML format to it. The server then forwards this document to the
>client. when you try to execute a program in background using CGI the server
>is still waiting for the child program to terminate. In effect waiting for
>the complete output which it will forward to client. Thus the server process
>waits indefinitely for the child process to terminate. Also as the
>background process does not terminate, every request to the cgi script will
>create one more instance to the same program in memory overloading your
>system.
>
>So, I think this is a bad idea to create background processes using a web
>server.
>
>Can we know what exactly is the motive, we may be able to suggest some
>better way.
>
>Kapil Sethi
>System Administrator
>BharatConnect Ltd.
>Ph: 011-6430987
>----- Original Message -----
>From: "Manish K Arya" <[EMAIL PROTECTED]>
>To: "general linux" <[EMAIL PROTECTED]>; "linux programmers"
><[EMAIL PROTECTED]>
>Sent: Tuesday, January 22, 2002 11:03 AM
>Subject: [ilugd]: (No Subject)
>
>
>> hi
>> i was trying to run a program in background thru cgi and php.
>> i have written a shell script to intialize the C program that i want to
>run in background
>> like
>>
>> #/bin/bash
>> program&
>>
>> and now i try to run this shell script thru C cgi using system() in C cgi
>and exec() in php.
>> program gets started in background properly.but the problem is that web
>browser gets busy(loading icon glows).and statements after exec()/system()
>are not executed.i dont know why it is happening.
>>
>> pls suggest
>>
>> ---
>> Manish Kumar Arya
>> --------------------------------------------
>> While universe
>> {
>> Object emerges from zero, tends to infinity and finally end in zero.
>> }
>> --------------------------------------------
>>
>>
>>
>>
>>
>>
>> ================================================
>> To subscribe, send email to [EMAIL PROTECTED] with subscribe in
>subject header
>> To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in
>subject header
>> Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
>> =================================================
>>
>
>================================================
To subscribe, send email to [EMAIL PROTECTED] with subscribe in subject header
To unsubscribe, send email to [EMAIL PROTECTED] with unsubscribe in subject header
Archives are available at http://www.mail-archive.com/ilugd%40wpaa.org
=================================================
-- - Popi Classification -------------------------------------------------------
Classification applies if checked...
[ ] General Business Information
[ ] Motorola Internal Use only
[ ] Motorola Confidential Proprietary
--- A Nice Quote --------------------------------------------------------------
"When the only tool you have is a hammer, you tend to treat everything
as if it were a nail." -- Abraham Maslow
-- Contact Me -----------------------------------------------------------------
Rajat Bhatia
[EMAIL PROTECTED] Tel: +91-124-6307212 Ext 1350 +91-124-6303212 EPABX Operator Fax : +91-124-6306679 |
|