使用supervisord运行python脚本

使用supervisord运行python脚本,python,discord,supervisord,Python,Discord,Supervisord,我有一个简单的python脚本(),当我使用命令python3 discord\u bot.py&或sh start\u bot.sh运行它时,它运行得很好。 但我怎么能和督导员一起做呢 更新: 我已经安装了supervisord。但当我尝试运行进程时,出现错误: exit status 0; not expected 我的命令配置: [program:AFI] command=/home/maksymov/www/Bots/discord_bots/afi/start_bot.sh auto

我有一个简单的python脚本(),当我使用命令
python3 discord\u bot.py&
sh start\u bot.sh
运行它时,它运行得很好。 但我怎么能和督导员一起做呢

更新: 我已经安装了supervisord。但当我尝试运行进程时,出现错误:

exit status 0; not expected
我的命令配置:

[program:AFI]
command=/home/maksymov/www/Bots/discord_bots/afi/start_bot.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/afi.err.log
stdout_logfile=/var/log/afi.out.log
user=www-data

也许你需要使用一个“主管”。像system.d或


第一个更一般。第二个更“特定于python”

我猜您的程序试图作为守护进程运行。我粘贴了文档中最相关的部分:

本应在supervisor下运行的程序不应将其自身后台监控。相反,它们应该在前台运行。它们不应与启动它们的终端分离


判断程序是否将在前台运行的最简单方法是从shell提示符运行调用程序的命令。如果它让您重新控制终端,但仍在运行,则它将自身后台监控,而这几乎肯定是在主管下运行它的错误方式。

我相信您可以