Supervisor is a client server system that allows users to monitor and control the number of processes on Unix-like operating systems.
Official website http://supervisord.org
Installation
1. Easy_install Supervisor
2.
Setuptools (latest) from Http://pypi.python.org/pypi/setuptools.
MELD3 (latest) from http://www.plope.com/software/meld3/.
ElementTree (latest) from Http://effbot.org/downloads#elementtree.
Setting up a configuration file
echo_supervisord_conf >/etc/supervisord.conf
Specify the configuration file
Supervisord-c supervisord.conf
Find profile Path via
-C Specify configuration file
When no configuration file is specified, the lookup order:
1 $CWD/supervisord.conf
2 $CWD/etc/supervisord.conf
3/etc/supervisord.conf
Configuration file Description
HTTP/XML-RPC Related Configurations
[Unix_http_server]
File =/tmp/supervisor.sock
chmod = 0777
chown= Nobody:nogroup
Username = user
Password = 123
Web Management Interface Configuration
[Inet_http_server]
Port = 127.0.0.1:9001
Username = user
Password = 123
[Supervisorctl]
ServerURL = Unix:///tmp/supervisor.sock and [Unix_http_server] Match
Username = Chris
Password = 123
prompt = Mysupervisor
Configuration such as log environment
[Supervisord]
LogFile =/tmp/supervisord.log
Logfile_maxbytes = 50MB
logfile_backups=10
LogLevel = info
Pidfile =/tmp/supervisord.pid
Nodaemon = False
Minfds = 1024
Minprocs = 200
Umask = 022
user = Chrism
Identifier = Supervisor
Directory =/tmp
Nocleanup = True
Childlogdir =/tmp
Strip_ansi = False
Environment = key1= "value1", key2= "value2"
Configure a single process
[Program:theprogramname]
Command=/bin/cat; The program (relative uses PATH, can take args)
process_name=% (program_name) s; Process_name Expr (default% (program_name) s)
Numprocs=1; Number of processes copies to start (Def 1)
directory=/tmp; Directory to CWD to before exec (Def no CWD)
umask=022; Umask for process (default None)
priority=999; The relative start priority (default 999)
Autostart=true; Start at Supervisord start (default:true)
autorestart=unexpected; Whether/when to restart (default:unexpected)
Startsecs=1; Number of secs prog must stay running (def. 1)
startretries=3; Max # of Serial start failures (default 3)
exitcodes=0,2; ' Expected ' exit codes for process (default 0,2)
Stopsignal=quit; Signal used to kill process (default term)
stopwaitsecs=10; Max num secs to wait b4 SIGKILL (default 10)
Stopasgroup=false; Send stop signal to the UNIX process group (default false)
Killasgroup=false; SIGKILL the UNIX process group (Def false)
User=chrism; Setuid to this UNIX account to run
Redirect_stderr=true; REDIRECT Proc stderr to stdout (default false)
Stdout_logfile=/a/path; StdOut log path, none for none; Default AUTO
STDOUT_LOGFILE_MAXBYTES=1MB; Max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10; # of StdOut logfile backups (default 10)
STDOUT_CAPTURE_MAXBYTES=1MB; Number of bytes in ' capturemode ' (default 0)
Stdout_events_enabled=false; Emit events on StdOut writes (default false)
Stderr_logfile=/a/path; stderr log path, none for none; Default AUTO
STDERR_LOGFILE_MAXBYTES=1MB; Max # logfile bytes b4 rotation (default 50MB)
stderr_logfile_backups=10; # of stderr logfile backups (default 10)
STDERR_CAPTURE_MAXBYTES=1MB; Number of bytes in ' capturemode ' (default 0)
Stderr_events_enabled=false; Emit events on StdErr writes (default false)
Environment=a= "1", b= "2"; Process Environment Additions (def no adds)
Serverurl=auto; Override ServerURL computation (childutils)
In addition, the configuration also has
[Fcgi-program:x]
[EVENTLISTENER:X]
[Rpcinterface:x]
Contains the specified configuration file
[include]
Files =/an/absolute/filename.conf/an/absolute/*.conf foo.conf config??. Conf
"Linux" Unix-like operating system process monitoring and control tool Supervisor