Wednesday, May 13, 2015

Installing pip and supervisor on mac

Start by getting installing pip from the following link:

https://pip.pypa.io/en/stable/installing.html

Insall supervisor (there's no stable release of supervisor at the time of this writing, use the --pre flag):

> pip install supervisor --pre

Supervisor should be running already.

Copy the config to /etc

> echo_supervisord_conf > /etc/supervisord.conf

If supervisord is not already started, run supervisord in the directory your desired config is located. If you don't want to use the /etc/supervisord.conf and you have it somewhere else, run it there.

Start supervisord

> supervisord

Restart all supervisor processes.

> sudo supervisorctl restart all

If you want to start a program, you need to use :*, as supervisord names each program along with it's process name. Assume you defined your program as [program:hello]:

> supervisorctl
> start hello:*

Stop supervisor:

> ps -ef | grep supervisord

This should show the process id running supervisord. Terminate it by issuing a kill command.

501 95787     1   0 Fri07pm ??         0:02.92 /usr/bin/python /usr/local/bin/supervisord

> kill -s SIGTERM 95787

For a sample supervisord config, check here.

No comments:

Post a Comment