Supervisor: Process Management Tools

Source: Internet
Author: User
Tags emit

One, install (either way)
    • Apt-get Install Supervisor
    • Easy_install Supervisor
    • Pip Install Supervisor
Two, configure
    1. Configure supervisor.conf
      • Add Web Control Interface

2. Boot process Configuration Instructions

; Manage the configuration of a single process, create multiple, and the following are all possible configuration options; [Program:theprogramname];command=/bin/cat; The command to start the process uses a relative path, which can be added with parameters; Process_name=% (program_name) s; Process name expression (default%(program_name) s); Numprocs=1; Number of processes (Def 1);d irectory=/tmp; the directory where the command is executed (Def no cwd); Umask=022; Process default Permissions (defaultNone);p riority=999; Process Start relative priority (default999); Autostart=true; Follow supervisor Start-Up (default:true); AutoRestart=unexpected; Plan to start (default: unexpected); Startsecs=1; Delayed Start (def. 1); Startretries=3; Up to continuous start failure (default3); Exitcodes=0,2; Process End Code (default0,2); Stopsignal=quit; Signal used to kill process (defaultterm ); Stopwaitsecs=10; Maximum end wait time, otherwise use SIGKILL (default10); Stopasgroup=false; Do you want the UNIX process group to send an end signal (default false); Killasgroup=false; SIGKILL UNIX Process Group (deffalse); user=chrism; Set the user to start the program; Redirect_stderr=true; Standard error of the redirector to standard output (default false); Stdout_logfile=/a/path; Log path for standard output, NONE forNonedefaultauto;stdout_logfile_maxbytes=1MB; Log file maximum value, otherwise the loop writes (default50MB); Stdout_logfile_backups=10; Number of standard output log backups (default10); Stdout_capture_maxbytes=1MB; Number of bytes in ' Capturemode ' (default0); stdout_events_enabled=false; Emit events on StdOut writes (default false); Stderr_logfile=/a/path; Standard error output log path, NONE forNonedefaultauto;stderr_logfile_maxbytes=1MB; Log file maximum value, otherwise the loop writes (default50MB); Stderr_logfile_backups=10; Number of standard error log backups (default10); Stderr_capture_maxbytes=1MB; Number of bytes in ' Capturemode ' (default0); stderr_events_enabled=false; Emit events on StdErr writes (default false); Environment=a= "1", b= "2"; process attach environment (Def no adds); ServerURL=auto; Override ServerURL computation (childutils)

Configuration Example:

Note:

    • The file must be placed under the CONF.D folder
    • The configuration file name suffix must be. conf
Third, management tools
    1. SUPERVISORCTL Management Terminal:
Supervisorctl Status: View the currently running list of processes Supervisorctl stop XXX: Stop a process (XXX), XXX for the value configured in [Program:theprogramname]. Supervisorctl start XXX: Start a process supervisorctl restart XXX: Restart a process supervisorctl stop groupworker: Restart all processes that belong to the group named Groupworker (Start,restart) Supervisorctl stop all, stop the whole process, note: Start, restart, stop will not load the latest configuration file. Supervisorctl Reload, load the latest configuration file, stop the original process and start and manage all processes in the new configuration. Supervisorctl Update, depending on the latest configuration file, start a new configuration or a changed process, configure the unchanged process will not be affected and restart. Note: Displays a process that stops with stop and does not restart automatically with reload or update.

2.web

Four, FAQ
* starting Supervisor Daemon Manager ... Error:another program was already listening on a  port the one of our HTTP servers are configured to use.  This  /usr/bin/supervisord-h......fail!
Method: Http://stackoverflow.com/questions/14479894/stopping-supervisord-shut-down

Supervisor: Process Management Tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.