Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbwoodside/20752b60d92043f93b396ef89d74b30b to your computer and use it in GitHub Desktop.
Save sbwoodside/20752b60d92043f93b396ef89d74b30b to your computer and use it in GitHub Desktop.
Setting up supervisord in Mac OS X

Installation

Installing Supervisor on OS X is simple:

sudo pip install supervisor

This assumes you have pip. If you don't:

curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py
sudo easy_install pip
sudo pip install supervisor

Create the conf.d directory that you can put subprocess configuration files into:

sudo mkdir -p /usr/local/etc/supervisor/conf.d/

Test supervisord in non-daemon mode:

supervisord -n -c /usr/local/etc/supervisord.conf

Assuming you put supervisord.conf in /usr/local/etc/ then supervisord will find it automatically. Test it:

supervisord -n

Enter supervisor interactive mode:

supervisorctl
<!-- /Library/LaunchDaemons/com.agendaless.supervisord.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>com.agendaless.supervisord</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/supervisord</string>
<string>-n</string>
<string>-c</string>
<string>/usr/local/share/supervisor/supervisord.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
# /usr/local/etc/supervisord.conf
[unix_http_server]
file=/usr/local/var/run/supervisor.sock ; (the path to the socket file)
chmod = 0770
chown = root
[supervisord]
logfile = /usr/local/var/log/supervisord.log
pidfile = /usr/local/var/run/supervisord.pid
childlogdir = /tmp
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///usr/local/var/run/supervisor.sock
[include]
files = /usr/local/etc/supervisor/conf.d/*.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment