I have a PHP script that works as a cron job. The script uses the database to see if it has anything to do, and to make sure that its brothers are not already running.
I would like to run a PHP script as a daemon with upstart .
I installed the /etc/init/super-mailer.conf file as follows:
description "super mailer" author "Rob Nugen" start on startup stop on shutdown respawn exec sudo -u www-data php -f /var/www/super-mailer/scripts/mailer.php
I execute sudo start super-mailer and it starts once.
However, it does not start again. Why not?
I also tried replacing the string exec sudo with
script sudo -u www-data php -f /var/www/clubberia-mailer/scripts/mailer.php end script
Do I need to change my PHP script to a loop? How can I say that you cannot run the script?
source share