Installation and configuration of the Supervisor process monitoring and management tool on Mac

Source: Internet
Author: User
This article mainly introduces the installation and configuration of the Supervisor process monitoring management tool in Mac. the Supervisor is written in Python and is a process monitoring management tool in unix-like operating systems, this article describes the configuration and installation of MAC systems. For more information about how to use the Supervisor as a process monitoring and management tool for unix-like operating systems, see.

Install Supervisor

The Supervisor is written in Python and can be directly installed using the Python Package installation management tool pip (Python Package Index:

The code is as follows:


Sudo pip install supervisor

Configure a Supervisor

The configuration file of the Supervisor is named supervisord. conf, which provides configuration option settings for supervisord (the main service command of the Supervisor) and supervisorctl (the monitoring and management command of the Supervisor. The Supervisor does not specify the storage location of the configuration file supervisord. conf. by default, when the Supervisor service is started:

The code is as follows:


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

Find the configuration file supervisord. conf in these directories. The Supervisor also provides the "-c" parameter to specify the directory path of the configuration file.

Enter the "echo_supervisord_conf" command on the terminal to view the default configurations of the Supervisor.

Generate a default configuration file:

The code is as follows:


Echo_supervisord_conf>/etc/supervisord. conf

Some configurations are selected here, which are adequate. the configuration is as follows:

The code is 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 = 50 MB
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

The code is as follows:


Supervisord-c/etc/supervisord. conf

The "-c" parameter specifies the path of the Supervisor configuration file.

Add supervisord to the system startup service

The code is 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



Start the Supervisor service:

The code is as follows:


Launchctl load ~ /Library/LaunchAgents/dengjoe. supervisord. plist

Supervisorctl monitoring command

Supervisorctl is a background process control tool provided by the Supervisor. The following describes how to use this command:

Start the application:

The code is as follows:


Supervisorctl start program

Re-read configuration:

The code is as follows:


Supervisorctl update

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.