Re: Try to find a solution, when restart Apache with PHP Script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rodolfo De Nadai wrote:
No... it not should only run when i'm connected to it throught a web server... it means that when i go to specific IE page and press a button named 'Enable' the daemon should be called and start to run indefinitly, and i'm able to close IE session and the daemon keep working as well...

That's what i mean...

Well, in that case, what you could do is have a cron job, or if on windows some form of scheduled task, that looks for a file that indicates that it should be running.

Then from apache, you could setup a page that has your enable button. When submitted, it creates a file that indicates to the above scheduled task that it needs to run.

Then, when that scheduled task starts, it looks at the file and sees that it needs to be running, then it stays running. It checks to see if it has a pid file already created. if it cannot find a pid file, it creates a pid file to indicate that it is running. It checks every once in a while to see if the file that tells it that it needs to be running it still there, once that file goes away, it kills the pid file and kills itself too.

Then the scheduled jobs keeps checking...

You might find that you need to do a little refinement to this process. But, this is where I would start.


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux