On 26 Jun 2004 03:53:06 -0700,
kc***@cox.net (KeOu) wrote:
Hi,
We are running a application on the Linux, and would like to have a web
interface to restart it remotely using PHP. I would like to get an
advice on how to do it.
Does the program need to run started as root? The ID you're using to
run PHP? Important questions.
If the program can be started by the same user running php (NOT ROOT),
use the system("/path/to/command); syntax. Otherise:
Create a cron job that runs regularly (like every 5 minutes). Have it
check for the existance of a file where the php ID can write and the
cron job can read and write. Have your php create a file (it can be
empty) and have the cron job watch for its existance.
If the file exists, the cron job restarts the program and removes the
file. If the file doesn't exist, the cron job does nothing.
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one!
http://www.databasix.com
================================================== =========================