Simple supervisor teaching and supervisor Teaching

Source: Internet
Author: User

Simple supervisor teaching and supervisor Teaching

A supervisor can be used to protect processes running in linux and provide functions such as start, stop, and restart to prevent the processes from being killed by other processes by mistake.

  • First, apt-get install supervisor
  • Supervisord is the main program of daemon. It generates the default configuration file echo_supervisord_conf>/etc/supervisord. conf and serves supervisord-c/home/supervisord. conf.
  • Open supervisorctl and find that no monitored service is available.
  • Now write the Process configuration to be managed, similar to the following
  • [Program: gftrader] command = python3/home/gftrader/runStrategy. pydirectory =/home/gftrader/autorestart = truelog_stdout = truelog_stderr = trueexitcodes = 0, 2 stopsignal = QUITstopwaitsecs = 10stdout_logfile =/tmp/gftrader. log

     

  • Supervisorctl reread: click it, And then update it to view the status. help can look at other commands.

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.