Installation and Getting Started tutorials for Linux process management tool Supervisord

Source: Internet
Author: User

Supervisor is a process management tool, the official saying:

The purpose is to have a process that needs to run all the time, but this process can be interrupted for a variety of reasons. I want to be able to restart it automatically when the process is interrupted, and I need to use the supervisor

There are two main commands:

    • Supervisord : Supervisor Server-side section, starting supervisor is running this command
    • Supervisorctl: Launches the command-line window for supervisor.
Installation (CentOS):

Way One:

Yum-y Install Python-setuptoolseasy_install Supervisor

Way two:

If the easy_install is not good, download it from the official:

wget https://pypi.python.org/packages/source/s/supervisor/supervisor-3.1.3.tar.gz

Then install it through Python:

Tar zxf supervisor-3.1.3.tar.gzcd supervisorpython setup.py Install

After a successful installation, you can log in to the Python console and enter import supervisor to see if it will load successfully.

Build configuration file (supervisord.conf):
echo_supervisord_conf >/etc/supervisord.conf
To modify a configuration file:

The last increment in supervisord.conf (the expression comment behind the semicolon, can not be written):

[program:bandwidth]command=python26/usr/local/bin/bandwidth.sh; command to be executed WD] User=root;(d Efault is the current user, Required if root) autostart=true; start at supervisord start (default:true) autorestart=true, whether/when to restart (de fault:unexpected) startsecs=3; number of secs prog must stay running (def. 1) stderr_logfile=/tmp/bandwidth_err.log; redi RECT proc stderr to stdout (default false) Error output redirect Stdout_logfile=/tmp/bandwidth.log; stdout log path, none for none; Default AUTO, log output

(For more configuration instructions please refer to: http://supervisord.org/configuration.html)

To run the command:

Start Supervisor

Supervisord-c/etc/supervisord.conf

Open command Line

[Email protected] bin]# supervisorctl status bandwidth RUNNING pid 2423, uptime 0:06:35 [[EMA Il protected] bin]# supervisorctl Help default commands (Type help <topic>): ================================= = = = Add Clear FG Open quit remove restart start stop update avail exit Maintail PID Reloa D Reread shutdown status tail version

CTL: Help//view command

In CTL: status//view state

Special attention:

If you modify the /etc/supervisord.conf, you need to perform supervisorctl reload to reload the configuration file, otherwise it will not take effect ...

Installation and Getting Started tutorials for Linux process management tool Supervisord

Related Article

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.