【发布时间】:2020-10-22 04:03:30
【问题描述】:
我有一个脚本(网络监听器),它可以自行运行而没有问题:
> /usr/bin/python3 /home/[user]/scripts/CrossPlatform/workflow_trigger.py
我已经有一个运行良好的不同服务。所以,我以新名称 /etc/systemd/system/my_workflow.service 复制了该文件:
Description=My Service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/python3 /home/[user]/scripts/CrossPlatform/workflow_trigger.py
[Install]
WantedBy=multi-user.target
ExecStart 行是成功运行的命令的直接副本。
然后我运行:
systemctl daemon-reload
systemctl start my_service.service
它在没有消息的情况下运行。不幸的是:
systemctl status my_service.service
演出:
my_service.service - My Service
Loaded: loaded (/etc/systemd/system/my_service.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2020-07-01 10:57:35 CDT; 958ms ago
Process: 2722 ExecStart=/usr/bin/python3 /home/[user]/scripts/CrossPlatform/workflow_trigger.py (code=exited, status=1/FAILURE)
Main PID: 2722 (code=exited, status=1/FAILURE)
操作系统是:
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
什么可能是修复? 非常感谢, 波格丹
【问题讨论】: