gpt4 book ai didi

linux - 为 uwsgi 设置 systemctl

转载 作者:太空狗 更新时间:2023-10-29 12:25:37 26 4
gpt4 key购买 nike

我正在尝试将 uwsgi 服务设置为 /etc/systemd/system/emperor.uwsgi.service

[Unit]
Description=uWSGI Emperor
After=syslog.target

[Service]
ExecStart=/root/uwsgi/uwsgi --ini /etc/uwsgi/emperor.ini
# Requires systemd version 211 or newer
RuntimeDirectory=uwsgi
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

尝试启动它时,出现以下错误:

ubuntu@ip-172-31-16-133:~$ sudo systemctl start emperor.uwsgi.service
Job for emperor.uwsgi.service failed because the control process exited with error code. See "systemctl status emperor.uwsgi.service" and "journalctl -xe" for details.

这是我检查状态时的输出:

ubuntu@ip-172-31-16-133:~$ sudo systemctl status emperor.uwsgi.service
● emperor.uwsgi.service - uWSGI Emperor
Loaded: loaded (/etc/systemd/system/emperor.uwsgi.service; disabled; vendor preset: enabled)
Active: inactive (dead)

Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Stopped uWSGI Emperor.
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Starting uWSGI Emperor...
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Main process exited, code=exited
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Failed to start uWSGI Emperor.
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Unit entered failed state.
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Failed with result 'exit-code'.
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Service hold-off time over, sche
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Stopped uWSGI Emperor.
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: emperor.uwsgi.service: Start request repeated too quick
Jan 30 11:16:05 ip-172-31-16-133 systemd[1]: Failed to start uWSGI Emperor.

最佳答案

我遇到过类似的问题。似乎 systemd 在启动 (UWSGI) 服务失败时吞下了一些输出。以下是一些需要检查的事项,以找出导致问题的原因:

  1. 检查 systemd 日志:journalctl -b -u $service
  2. 尝试手动运行该服务:只需运行 systemd 服务文件中 ExecStart= 后指定的 cmdline;所以在你的例子中:/root/uwsgi/uwsgi --ini/etc/uwsgi/emperor.ini

其中任何一个都可以说明服务是否无法启动。

关于linux - 为 uwsgi 设置 systemctl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41937017/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com