Created
January 30, 2011 05:10
-
-
Save didip/802561 to your computer and use it in GitHub Desktop.
Example configuration file for supervisord.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/tmp/supervisor.sock ; path to your socket file | |
[supervisord] | |
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
logfile_backups=10 ; number of backed up logfiles | |
loglevel=error ; info, debug, warn, trace | |
pidfile=/var/run/supervisord.pid ; pidfile location | |
nodaemon=false ; run supervisord as a daemon | |
minfds=1024 ; number of startup file descriptors | |
minprocs=200 ; number of process descriptors | |
user=root ; default user | |
childlogdir=/var/log/supervisord/ ; where child log files will live | |
[rpcinterface:supervisor] | |
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | |
[supervisorctl] | |
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket | |
; This is where you run individual Tornado instances. | |
; We run four; one per processor core. | |
; In development, we ran as many as four per core with no issues. | |
; If you're looking to minimize cpu load, run fewer processes. | |
; BTW, Tornado processes are single threaded. | |
; To take advantage of multiple cores, you'll need multiple processes. | |
[program:tornado-8000] | |
command=/path/to/app.py --port=8000 | |
stderr_logfile = /var/log/supervisord/tornado-stderr.log | |
stdout_logfile = /var/log/supervisord/tornado-stdout.log | |
[program:tornado-8001] | |
command=/path/to/app.py --port=8001 | |
stderr_logfile = /var/log/supervisord/tornado-stderr.log | |
stdout_logfile = /var/log/supervisord/tornado-stdout.log | |
[program:tornado-8002] | |
command=/path/to/app.py --port=8002 | |
stderr_logfile = /var/log/supervisord/tornado-stderr.log | |
stdout_logfile = /var/log/supervisord/tornado-stdout.log | |
[program:tornado-8003] | |
command=/path/to/app.py --port=8003 | |
stderr_logfile = /var/log/supervisord/tornado-stderr.log | |
stdout_logfile = /var/log/supervisord/tornado-stdout.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hunt3r: I solve the problem i believe you are having, by doing the following (am currently using the Amazon Linux AMI on EC2 which is loosely based on CentOS):
all as root user:
!/bin/sh
Amazon Linux AMI startup script for a supervisor instance
chkconfig: 2345 80 20
description: Autostarts supervisord.
derived from: https://gist.github.com/mhayes/866900
Source function library.
. /etc/rc.d/init.d/functions
supervisorctl="/root/supervisor/bin/supervisorctl"
supervisord="/root/supervisor/bin/supervisord"
config_file="/etc/supervisord.conf"
supervisor_start="$supervisord -c $config_file"
supervisor_stop="$supervisorctl shutdown"
name="supervisor-python"
[ -f $supervisord ] || exit 1
[ -f $supervisorctl ] || exit 1
RETVAL=0
start() {
echo -n "Starting $name: "
$supervisor_start
RETVAL=$?
echo
return $RETVAL
}
stop() {
echo -n "Stopping $name: "
$supervisor_stop
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
esac
exit $REVAL
6. chmod +x /etc/init.d/supervisord
7. chkconfig —add supervisord
8. chkconfig supervisord on
9. service supervisord start
Hope this helps!