当前位置:网站首页>Supervisor process management installation and use

Supervisor process management installation and use

2020-11-07 20:57:56 Coxhuang

List of articles

  • supervisor Install and use
    • #1 Environmental Science
    • #2 demand
    • #3 Start
    • #4 Example

supervisor Install and use

#1 Environmental Science

Ubuntu16.04
Python 3.8.1

#2 demand

  • Monitor progress

#3 Start

  • install
sudo apt-get install supervisor
  • start-up
service supervisor start
 perhaps 
supervisord -c /etc/supervisor/supervisord.conf
  • Generate configuration files
echo_supervisord_conf > /etc/supervisor/supervisord.conf
  • Profile path
sudo mkdir -p /etc/supervisor/conf.d/
vim /etc/supervisor/supervisord.conf

Add the following at the end :

[include]
files = /etc/supervisor/conf.d/*.conf
  • Start visual interface

In the configuration supervisord.conf The file opens the following comments

[inet_http_server]         ; inet (TCP) server disabled by default
port=0.0.0.0:9002        ; (ip_address:port specifier, *:port for all iface)
username=user              ; (default is no username (open server))
password=123               ; (default is no password (open server))
  • Use

Command line

explain

supervisord

start-up

supervisord -c /etc/supervisor/supervisord.conf

With xxx Profile startup

supervisorctl

Go to the command line

supervisorctl status

Check the status

supervisorctl reload

Reload configuration

supervisorctl start processname

Start the process

supervisorctl stop processname

Close the process

supervisorctl restart processname

Restart the process

#4 Example

xxx.conf

[group:multiprocesstest]
programs=multiprocess

[program:multiprocess]
command=python3 /home/cox/work/test/multiprocess_suspend/multiprocess_suspend.py
directory=/home/cox
user=cox
autorestart=true
redirect_stderr=true
stopasgroup=true

Official documents :

http://supervisord.org/configuration.html

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[Coxhuang]所创,转载请带上原文链接,感谢