Installation and configuration of Supervisor process monitoring and management tool under Mac

Source: Internet
Author: User
Supervisor is a process monitoring management tool under a UNIX-like operating system.

Installing Supervisor

Supervisor is written by Python and can be installed directly using Python's Package Installation management tool PIP (Python pack Index):

Copy the Code code as follows:


sudo pip install Supervisor

Configure Supervisor

The configuration file for Supervisor is named Supervisord.conf, which provides configuration option settings for Supervisord (Supervisor's Primary service command) and Supervisorctl (Supervisor's monitoring Management command). Supervisor does not specify the location of the configuration file supervisord.conf, the Supervisor service starts by default when:

Copy the Code code as follows:


$CWD/supervisord.conf
$CWD/etc/supervisord.conf
/etc/supervisord.conf

These directory locations find the configuration file supervisord.conf. Supervisor also provides the parameter "-C" to specify the directory path of the configuration file.

Enter the "echo_supervisord_conf" command at the terminal to view the contents of the Supervisor default configuration.

Generate a copy of the default configuration file:

Copy the Code code as follows:


echo_supervisord_conf >/etc/supervisord.conf

Here are the options to set up some configuration, basic enough, configured as follows:

Copy the Code code as follows:


[Inet_http_server]
Port = 127.0.0.1:9001
Username = DHQ
Password = 123456

[Unix_http_server]
File =/tmp/supervisor.sock
chmod = 0700

[Supervisord]
LogFile =/users/dengjoe/.supervisor/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 =/tmp
Nocleanup = True
Childlogdir =/tmp

[Supervisorctl]
ServerURL = Unix:///tmp/supervisor.sock

[Rpcinterface:supervisor]
Supervisor.rpcinterface_factory = Supervisor.rpcinterface:make_main_rpcinterface



[Program:shadowsocks]
Directory =/users/dengjoe/shadowsocks
Command =/usr/bin/python/users/dengjoe/shadowsocks/local.py
Autostart = True
AutoRestart = True

Start Supervisor

Copy the Code code as follows:


Supervisord-c/etc/supervisord.conf

The parameter "-C" indicates the path to the specified Supervisor configuration file

Adding Supervisord to the system startup service

Copy the Code code as follows:


<?xml version= "1.0" encoding= "UTF-8"?>



KeepAlive

Successfulexit


Label
Dengjoe.supervisord
Programarguments

/usr/local/bin/supervisord
-N
-C
/etc/supervisord.conf

Runatload



To start the Supervisor service:

Copy the Code code as follows:


Launchctl Load ~/library/launchagents/dengjoe.supervisord.plist

Supervisorctl Monitoring Commands

Supervisorctl is Supervisor's own background Process Control tool, here are some uses of the command:

To launch an app:

Copy the Code code as follows:


Supervisorctl Start Program

To re-read the configuration:

Copy the Code code as follows:


SUPERVISORCTL Update
  • 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.