Centos – Continually check to make sure php script is running

centosgnu-screenmonitoringPHPssh

Is it possible to configure my CentOS VPS to continually check to make sure that a php script is running? Currently I'm using the screen php method which works fine, but if it gets terminated somehow, how can I start it backup?

I tried adding the command to /etc/rc.d/rc.local, however this morning I checked, and the script wasn't running.

Best Answer

This task is well suited to a process monitor like Monit.

The monitoring configuration will be made much easier with Monit if your PHP process produces a PID file. An article describing how to use Monit to check and start PHP processes is available here.

Related Topic