6

I'm trying to get supervisor working to make sure my queue system is always running.

Here are the steps I took, which I pieced together from various sources: (Ran as root or super user)

  1. Ran:

    # easy_install supervisor
    # echo_supervisord_conf > /etc/supervisord.conf
    # vi supervisord.conf
    
  2. Pasted the following to end of file:

    command=/usr/bin/php /path/to/AppName/artisan --env=production --timeout=240 queue:listen
    
  3. Ran:

    # supervisord -c /etc/supervisord.conf
    # supervisorctl
    supervisor> status
    supervisor>
    

    It does not display anything.

  4. Ran:

    # service supervisord reload
    supervisord: unrecognized service
    

2 Answers2

5

to get supervisord running as a service you need an /etc/init.d/supervisord file. i used https://raw.githubusercontent.com/Supervisor/initscripts/master/redhat-init-equeffelec with mods to match the path which easy_install put the binaries at (/usr/local/bin/) and to find the pid and logs in /var/run/ and /var/log/

4

I just spent a couple hours on this, trying to get supervisor and Amazon Linux AMI to play nice. I was experiencing exactly the symptoms you mentioned.

Some quirks:

  • go ahead and include -c /etc/supervisord.conf (or whatever your path) on any supervisord or supervisorctl command, and make sure you run from the same user every time.
  • in your /etc/supervisord.conf, when you append the command, make sure you prefix the name with 'program:', like so:

    [program:queue]
    command=/usr/bin/php /path/to/AppName/artisan --env=production --timeout=240 queue:listen
    

Once I did the above, supervisorctl FINALLY recognized the queue process/program.

I still haven't gotten sudo service supervisor restart to recognize supervisor as a service - I suspect it's because I don't have an upstart script that I've seen mentioned in a handful of places. Not sure I need one at this point.

Some debugging techniques I used:

  • ps aux | grep super to see if it's running
  • sudo vim to edit the /etc/supervisord.conf and sudo /usr/local/bin/supervisorctl -c /etc/supervisord.conf then avail, reload, update etc. to update (rather than editing .ebextensions and pushing to elastic beanstalk everytime)