0

I can not start uwsgi by systemctl.

my error log is here below.

$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.

I googled around and found this error might be related with anaconda.

I use uwsgi under conda environment. /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

I use command line /home/ubuntu/anaconda3/envs/py37/bin/uwsgi --ini /var/www/html/myapp/uwsgi.ini.

It works.

However how can I fix this??

my uwsgi.ini is here below

[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
3
  • Type=notify is probably wrong. Try Type=simple. You are sending stderr to syslog. Does syslog contain any log messages related? If you remove that line it will go to the journal with the other output.
    – jordanm
    Commented Apr 22, 2020 at 19:05
  • Also remove "daemonize" from your config. Services daemonizing themselves is typically undesirable on modern systems with systemd.
    – jordanm
    Commented Apr 22, 2020 at 19:07
  • Always take comment answers with a pinch of salt, especially when they are at odds with the "Systemd" chapter of the uWSGI manual and what is visible in the output of systemctl there in front of us. (-:
    – JdeBP
    Commented Apr 22, 2020 at 23:36

1 Answer 1

0

Update:

Type=notify

to

Type=Forking

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .