I have a script like this this:
#!/usr/bin/php
<?php
file_put_contents('/home/vagrant/sleep.pid', getmypid());
sleep(9);
exit(0);
I want to write my Monit config so it makes sure this application is always running. This is my monit config:
set daemon 5
check process program with pidfile /home/vagrant/sleep.pid
start program = "/usr/bin/php /home/vagrant/myphp.php"
But after my program exits Monit doesn't try to run it again. It kinda make sense but I was wondering if there is any way to tell Monit to rerun the process.