【发布时间】:2019-03-31 18:31:27
【问题描述】:
我写了一个小应用程序。该应用程序运行良好。但是,我正在尝试创建一个服务文件,但遇到了问题。运行命令sudo uwsgi uwsgi.ini 有效。应用程序启动。
我创建了一个服务文件。
[Unit]
Description=uWsgi instance to start relay site
After=network.target
[Service]
User=pi
Group=pi
WorkingDirectory=/var/www/relay
ExecStart=sudo uwsgi uwsgi.ini
[Install]
WantedBy=multi-user.target
我尝试启动服务文件时出错。
Loaded: error (Reason: Invalid argument)
relay.service: Unit entered failed state.
relay.service: Failed with result 'exit-code'.
[/etc/systemd/system/relay.service:11] Executable path is not absolute, ignoring: uwsgi uwsgi.ini
relay.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
[/etc/systemd/system/relay.service:9] Executable path is not absolute, ignoring: sudo uwsgi uwsgi.ini
relay.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
【问题讨论】:
标签: linux python-3.x flask raspberry-pi uwsgi