Skip to content

Instantly share code, notes, and snippets.

@fadhlirahim
Last active December 31, 2023 14:45
Show Gist options
  • Save fadhlirahim/78fefdfdf4b96d9ea9b8 to your computer and use it in GitHub Desktop.
Save fadhlirahim/78fefdfdf4b96d9ea9b8 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
supervisord -c /path/to/supervisord.conf

Seeing all child processes running

supervisorctl -c /path/to/supervisord.conf

I find it helpful to create an alias in my bash profile for those 2 commands above so that I don't have to manually type -c all the time

echo "alias supervisord='supervisord -c /usr/local/share/supervisor/supervisord.conf'" >> ~/.bash_profile
echo "alias supervisorctl='supervisorctl -c /usr/local/share/supervisor/supervisord.conf'" >> ~/.bash_profile
<!-- /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>
[unix_http_server]
file=/usr/local/share/tmp/supervisor.sock
chmod=0700
[supervisord]
logfile = /usr/local/var/log/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = False
minfds = 1024
minprocs = 200
umask = 022
identifier = supervisor
directory = /usr/local/share/tmp
nocleanup = true
childlogdir = /usr/local/share/tmp
[supervisorctl]
serverurl = unix:///usr/local/share/tmp/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[include]
files = /usr/local/share/supervisor/conf.d/*.conf
@fadhlirahim
Copy link
Author

Ensure supervisord and supervisorctl is run with the -c option and /path/to/supervisord.conf file

@fadhlirahim
Copy link
Author

Optional plist file to run supervisord on startup on your machine.

@black-lotus
Copy link

i can't download from this url http://python-distribute.org/distribute_setup.py
any idea ?
thanks

@infostreams
Copy link

Better way (2018): brew install supervisor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment