![在Linux中创建systemd服务单元](https://linux22.com/image/183016/%E5%9C%A8Linux%E4%B8%AD%E5%88%9B%E5%BB%BAsystemd%E6%9C%8D%E5%8A%A1%E5%8D%95%E5%85%83.png)
我想在Linux中创建一个systemd服务模块,这样我就不必在系统启动时输入命令:
cd /etc/mautrix-facebook/venv
source bin/activate
python3 -m mautrix_facebook
mautrix-facebook.service:
[Unit]
Description=Matrix-Facebook bridge
[Service]
WorkingDirectory=~
ExecStart=/etc/mautrix-facebook/venv/bin/python3 -m mautrix_facebook
User=alex
Restart=always
[Install]
WantedBy=multi-user.target
该模块尝试在 /etc/mautrix-facebook/venv/bin 中启动,我收到如下错误:
FileNotFoundError: [Errno 2] No such file or directory: 'config.yaml'
如何让模块在 /etc/mautrix-facebook/venv 中运行?