参考:
https://blog.csdn.net/jiexijihe945/article/details/134716094
#安装supervisor
pip install supervisor-win -i https://mirrors.aliyun.com/pypi/simple
#生成配置文件
echo_supervisord_conf.exe > D:\supervisord.conf
#配置文件示例
[program:theprogramname]
command=cmd.exe ; the program (relative uses PATH, can take args)
directory=%(ENV_TMP)s ; directory to cwd to before exec (def no cwd)
autostart=true ; start at supervisord start (default: true)
startsecs=1 ; # of secs prog must stay up to be running (def. 1)
startretries=3 ; max # of serial start failures when starting (default 3)
autorestart=unexpected ; when to restart if exited after running (def: unexpected)
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=a\\path ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10)
#启动
?D:\conda\envs\supervisord\Scripts\supervisorctl.exe -c D:\conda\envs\supervisord\Scripts\supervisord.conf
#重新加载,修改了supervisord.conf必须reload
D:\conda\envs\supervisord\Scripts\supervisorctl.exe reload
#查看状态
D:\conda\envs\supervisord\Scripts\supervisorctl.exe status
#启动程序
D:\conda\envs\supervisord\Scripts\supervisorctl.exe start <program name>
#停止程序
D:\conda\envs\supervisord\Scripts\supervisorctl.exe stop <program name>