mercredi 31 décembre 2014

PHP Upstart on Amazon EC2 Linux (Elasticbeanstalk)

I have a couple of PHP scripts that I have run for ages successfully on Ubuntu (AWS EC2) as Upstart daemon services. Currently in the process of migrating the stand alone EC2 to an ElasticbeanStalk worker application. Generally this has worked well and I have the deamons and some CRON jobs setup fine using Elasticbeanstalk extensions. The problem I am having is the daemons are falling over. I know the PHP is fine as I can run from the command line (plus has been running well on Ubuntu). Similarly I am confident my Upstart .conf file (below) is fine as it came from Ubuntu and works perfectly there. It also starts as expected but continually fails with the unhelpful "terminated with status 1" error. Status 1 being pretty much anything as I understand.


Extract from /var/log/messages



Dec 31 11:33:47 ip-172-31-0-74 init: init-pulses main process (8809) terminated with status 1
Dec 31 11:33:47 ip-172-31-0-74 init: init-pulses main process ended, respawning


init-pulses.conf



start on filesystem and started elastic-network-interfaces
stop on shutdown
respawn
respawn limit unlimited

script
sudo -u root php /var/www/html/index.php scripts init_pulses
end script


The PHP script contains a loop but it never hits the PHP. There is something up with how I am executing the command although as I said this is totally cool on Ubuntu. I have tried various forms of the same all with the same problem. Can anyone offer any suggestions on how to construct the script block so it actually manages to fire the command or any ideas on how to debug this?


Any help, as always, much appreciated





Aucun commentaire:

Enregistrer un commentaire