无法启动uwsgi进程 [英] Could not start uwsgi process
问题描述
无法通过ini标志启动uwsgi进程
Could not start uwsgi process via ini flag
uwsgi --ini file.ini
没有任何uwsgi pids
Not any uwsgi pids
ps aux | grep uwsgi
root 31605 0.0 0.3 5732 768 pts/0 S+ 06:46 0:00 grep uwsgi
file.ini
[uwsgi]
chdir =/var/www/lvpp/site
wsgi-file =/var/www/lvpp/lvpp.wsgi
master = true
processes = 1
chmod-socket=664
socket = /var/www/lvpp/lvpp.sock
pidfile= /var/www/lvpp/lvpp.pid
daemonize =/var/www/lvpp/logs/lvpp.log
vacuum = true
uid = www
gid = www
env = DJANGO_SETTINGS_MODULE=settings
文件lvpp.log
file lvpp.log
*** Starting uWSGI 2.0.10 (32bit) on [Wed Apr 8 06:46:15 2015] ***
compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-11) on 17 March 2015 21:29:09
os: Linux-2.6.32-431.29.2.el6.i686 #1 SMP Tue Sep 9 20:14:52 UTC 2014
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 1
current working directory: /var/www/lvpp
writing pidfile to /var/www/lvpp/lvpp.pid
detected binary path: /var/www/lvpp/site/env/bin/uwsgi
setgid() to 503
setuid() to 501
chdir() to /var/www/lvpp/site/
your processes number limit is 1812
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
error removing unix socket, unlink(): Permission denied [core/socket.c line 198]
bind(): Address already in use [core/socket.c line 230]
很早就开始工作了.
但是当我调用kill -9 uwsgi.pid
时,无法再次启动uwsgi进程.
It worked early.
But when I invoked kill -9 uwsgi.pid
I could not start uwsgi process again.
为什么我不能再次启动uwsgi进程?
Why can't I start uwsgi process again?
推荐答案
关键是:
error removing unix socket, unlink(): Permission denied [core/socket.c line 198]
您(很可能)曾经以root用户身份运行uwsgi实例,并以root用户权限创建了unix套接字文件.
You (very probably) previously run a uwsgi instance as root creating the unix socket file with root permissions.
现在您的实例(改为以www身份运行)无法重新绑定()该套接字,因为它无法取消链接(无权限)
Now your instance (running instead as www) is not able to re-bind() that socket as it is not able to unlink it (no permissions)
只需删除套接字文件,然后重试即可.
Just remove the socket file and retry.
这篇关于无法启动uwsgi进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!