Configure and install supervisord
https://www.digitalocean.com/community/tutorials/how-to-install-and-manage-supervisor-on-ubuntu-and-debian-vps http://supervisord.org/configuration.html https://github.com/strongloop/node-foreman
easy_install supervisor
echo_supervisord_conf > /etc/supervisord.conf
supervisord -c /etc/supervisord.conf
echo -e "\n[include]\nfiles = /etc/supervisor/conf.d/*" > /etc/supervisord.conf
mkdir -p /etc/supervisor/conf.d/
supervisorctl reload
supervisorctl reread
Add suppervisord init script, to start on boot:
curl https://raw.githubusercontent.com/Supervisor/initscripts/master/redhat-init-mingalevme > /etc/rc.d/init.d/supervisord
chmod 755 /etc/rc.d/init.d/supervisord
chkconfig --add supervisord
chkconfig --list supervisord
chkconfig supervisord on
service supervisord start
I also had to add this to the init script: . /etc/bashrc
.
Use this to manage the init service:
service supervisord stop
service supervisord status
service supervisord restart
supervisorctl start 'cors:*'
supervisorctl update
Restarts apps whose configurations has changed. http://www.onurguzel.com/supervisord-restarting-and-reloading/
For this line
echo -e "\n[include]\nfiles = /etc/supervisor/conf.d/*" > /etc/supervisord.conf
Using > in
echo
not only includes what required into file, before this the command empty the file and after do the insert.I suggest to change this line to
echo -e "\n[include]\nfiles = /etc/supervisor/conf.d/*" >> /etc/supervisord.conf
that only put this at the final lines of the file.