按照Sourcery提供的建议修改systemctl管理指南
This commit is contained in:
@@ -120,6 +120,9 @@ sudo nano /etc/systemd/system/maimbot.service
|
|||||||
|
|
||||||
输入以下内容:
|
输入以下内容:
|
||||||
|
|
||||||
|
`<maimbot_directory>`:你的maimbot目录
|
||||||
|
`<venv_directory>`:你的venv环境(就是上文创建环境后,执行的代码`source maimbot/bin/activate`中source后面的路径的绝对路径)
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=MaiMbot 麦麦
|
Description=MaiMbot 麦麦
|
||||||
@@ -127,8 +130,8 @@ After=network.target mongod.service
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=/path/to/your/maimbot/
|
WorkingDirectory=<maimbot_directory>
|
||||||
ExecStart=/path/to/your/venv/python3 bot.py
|
ExecStart=<venv_directory>/python3 bot.py
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user