Autostart and keep your processes running on fail in Ubuntu 18.04 with supervisord

Just need to go through these articles:

  1. https://www.digitalocean.com/community/tutorials/how-to-install-and-manage-supervisor-on-ubuntu-and-debian-vps

Digitalocean has the greatest content!!

2. Here on more config options: https://stackoverflow.com/questions/27291448/supervisor-config-user-option-in-program-section

I wanted to run the script as a specific user, so in this case you just add to the /etc/supervisor/conf.d/<specific_file>.conf that has the supervisord options like:

  • which command to run (a consumer sending emails)
  • as which user (I want to run it as www-data)
  • whether it should start when the system boots up (autostart)
  • whether it should restart automatically (autorestart)

An example supervisor config:

[program:send_email_consumer]
command=php /var/www/examprep/bin/console rabbitmq:consumer send_email_consumer
autostart=true
autorestart=true
stderr_logfile=/var/log/send_email_consumer.err.log
stdout_logfile=/var/log/send_email_consumer.out.log
user=www-data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website with WordPress.com
Get started
%d bloggers like this: