A brief introduction to supervisor

零下一度
Release: 2017-06-29 10:40:46
Original
1386 people have browsed it

Supervisor can be used to protect processes running under Linux, providing start/stop/restart and other functions to ensure that the process is not accidentally killed by other processes.

  • First apt-get install supervisor

  • supervisord is the daemon main program, which generates the default configuration file echo_supervisord_conf > /etc/supervisord.conf, Start the service supervisord -c /home/supervisord.conf

  • Open supervisorctl and find that there are no monitored services.

  • Now write the process configuration to be managed, similar to the following

  • [program:gftrader]command=python3 /home/gftrader/runStrategy.py
    directory=/home/gftrader/
    autorestart=true
    log_stdout=true
    log_stderr=true
    exitcodes=0,2stopsignal=QUIT
    stopwaitsecs=10stdout_logfile=/tmp/gftrader.log
    Copy after login

  • supervisorctl reread, then update, status checks the status, help can look at other commands

The above is the detailed content of A brief introduction to supervisor. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!