如何使用守护进程启用多个discord bot?

2024-06-09 17:45:55 发布

您现在位置:Python中文网/ 问答频道 /正文

因此,我创建了一个名为discord@.service的守护程序服务,它的工作是启动/停止我的python discord bot,并使用类似systemctl start discord@mybot的命令获取它的状态,当我尝试启用时,systemctl返回我Failed to look up unit file state: Invalid argument

你能帮我一下吗? 守护程序代码:

[Unit]
Description=discord bots
After=multi-user.target
Conflicts=getty@tty1.service


[Service]
Type=simple
ExecStart=/usr/bin/python3.8 /home/myusername/bot/%i/%i.py
StandardInput=tty-force

[Install]
WantedBy=multi-user.target`enter code here`

Tags: to命令程序target状态botservicemulti