Python Supervisor Process Monitoring tool usage

Source: Internet
Author: User

SUPERVISOR--A Process Control System

GitHub Address: Https://github.com/Supervisor/supervisor

Can turn a normal command-line process into a background daemon is this true?? Such a cow!

You can use the Supervisor Process Monitoring tool to monitor the process, and if the process dies, the implementation can restart the process. The following article is good:

Https://www.cnblogs.com/zhaoding/p/6257363.html

The following is Supervisor's official website: http://supervisord.org/

Refer to the following article, Link: http://blog.csdn.net/ACxlm/article/details/62889460

Objective

Supervisor is a set of common process management programs developed in Python that can turn a normal command-line process into a background daemonand monitor the status of the process, which can be restarted automatically when the exception exits.

Installation

We can install a program called Supervisor on your Ubuntu to manage the startup of your scripts.

sudo apt-get install Supervisor

After installation we can find the supervisord.conf configuration file in/etc/supervisor/directory, we can use the following command to edit

sudo gedit/etc/supervisor/supervisord.conf

Configuration

At the end of the supervisord.conf this file, add the following:

[program:you program Name]//Your application name, casually named

command=python/home/pi/test.py//Your command can be any command that runs on the terminal

Autostart=true//Auto-start

Autorestart=true

User=root

Log_stderr=true

Logfile=/var/log/testpy.log//The address of the log file

Set Supervisor Boot

We need to edit the rc.local file in/etc and let the supervisor boot up. This allows the script to start running with supervisor at boot time.

sudo gedit/etc/rc.local

In the front row of exit 0 of this profile, add the service supervisor start to save.

Python Supervisor Process Monitoring tool usage

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.