I have a daemon written in PHP. I use the following command to call the daemon
php dojobs.php
when I call this command, the daemon starts endlessly because the dojobs.php file has the following code
while(true) { code here }
I have the following questions:
- How to use Monit (on a CENTOS linux 5.5 server) to monitor this daemon and restart it if it fails?
I have the following code inside the daemon:
exec ('nohup sendMail.php> / dev / null 2> & 1 and echo $!' ;, $ op);
(how can I make sure that the nohup command above works correctly and that the sendMail.php file actually does its job? SendMail.php is not a daemon, it sends an email and then exits.)
Thank you very much.
user816604
source share