uwsgiはsystemctlによって開始されませんでした。

uwsgiはsystemctlによって開始されませんでした。

systemctlを介してuwsgiを起動できません。

私のエラーログは次のとおりです。

$sudo systemctl status uwsgi.service
● uwsgi.service - uWSGI
   Loaded: loaded (/etc/systemd/system/uwsgi.service; enabled; vendor preset: enabled)
   Active: failed (Result: protocol) since Thu 2020-04-23 03:13:02 JST; 6s ago
 Main PID: 24676 (code=exited, status=0/SUCCESS)
   Status: "initializing uWSGI"

Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: uwsgi.service: Service hold-off time over, scheduling restart.
Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: uwsgi.service: Scheduled restart job, restart counter is at 5.
Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: Stopped uWSGI.
Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: uwsgi.service: Start request repeated too quickly.
Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: uwsgi.service: Failed with result 'protocol'.
Apr 23 03:13:02 ip-172-17-1-78 systemd[1]: Failed to start uWSGI.

Googleを試してみると、このエラーがアナコンダと関連している可能性があることがわかりました。

私はuwsgiconda環境で使用します。 /home/ubuntu/anaconda3/envs/py37/bin/uwsgi

uwsgi.service

[Unit]
Description = uWSGI
After = syslog.target

[Service]
ExecStart = /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini /var/www/html/myapp/uwsgi.ini
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

私はコマンドラインを使います/home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini /var/www/html/myapp/uwsgi.ini

効果がある

しかし、この問題をどのように解決できますか?

uwsgi.iniは私の下にいます。

[uwsgi]
chdir=/var/www/html/myapp/current
module=myapp.wsgi
env DJANGO_SETTINGS_MODULE=myapp.settings
http = 0.0.0.0:8008
processes = 4
threads = 1
master = 1
max-requests = 100
max-requests-delta = 5
pythonpath = /home/ubuntu/anaconda3/envs/py37/lib/python3.7/site-packages
pythonhome = /home/ubuntu/anaconda3/envs/py37/bin
harakiri = 280
daemonize = /var/log/uwsgi.log
log-reopen = true
log-maxsize = 8000000
logfile-chown = on
logfile-chmod = 644 
pidfile = /var/run/uwsgi/uwsgi.pid
stats = /var/run/uWSGI/projectname.stats.sock
memory-report = true

ベストアンサー1

修正する:

Type=notify

到着

Type=Forking

おすすめ記事