python – 无法启动uwsgi进程

前端之家收集整理的这篇文章主要介绍了python – 无法启动uwsgi进程前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

无法通过ini标志启动uwsgi进程

  1. uwsgi --ini file.ini

没有任何uwsgi pids

  1. ps aux | grep uwsgi
  2. root 31605 0.0 0.3 5732 768 pts/0 S+ 06:46 0:00 grep uwsgi

file.ini

  1. [uwsgi]
  2. chdir =/var/www/lvpp/site
  3. wsgi-file =/var/www/lvpp/lvpp.wsgi
  4. master = true
  5. processes = 1
  6. chmod-socket=664
  7. socket = /var/www/lvpp/lvpp.sock
  8. pidfile= /var/www/lvpp/lvpp.pid
  9. daemonize =/var/www/lvpp/logs/lvpp.log
  10. vacuum = true
  11. uid = www
  12. gid = www
  13. env = DJANGO_SETTINGS_MODULE=settings

文件lvpp.log

  1. *** Starting uWSGI 2.0.10 (32bit) on [Wed Apr 8 06:46:15 2015] ***
  2. compiled with version: 4.4.7 20120313 (Red Hat 4.4.7-11) on 17 March 2015 21:29:09
  3. os: Linux-2.6.32-431.29.2.el6.i686 #1 SMP Tue Sep 9 20:14:52 UTC 2014
  4. machine: i686
  5. clock source: unix
  6. pcre jit disabled
  7. detected number of cpu cores: 1
  8. current working directory: /var/www/lvpp
  9. writing pidfile to /var/www/lvpp/lvpp.pid
  10. detected binary path: /var/www/lvpp/site/env/bin/uwsgi
  11. setgid() to 503
  12. setuid() to 501
  13. chdir() to /var/www/lvpp/site/
  14. your processes number limit is 1812
  15. your memory page size is 4096 bytes
  16. detected max file descriptor number: 1024
  17. lock engine: pthread robust mutexes
  18. thunder lock: disabled (you can enable it with --thunder-lock)
  19. error removing unix socket,unlink(): Permission denied [core/socket.c line 198]
  20. bind(): Address already in use [core/socket.c line 230]

它起得很早.
但是当我调用kill -9 uwsgi.pid时,我无法再次启动uwsgi进程.

请告诉我,为什么我可以再次启动uwsgi进程?
谢谢

最佳答案
关键是:删除unix socket时出错,unlink():权限被拒绝[core / socket.c第198行]

您(很可能)以前以root身份运行uwsgi实例,创建具有root权限的unix套接文件.

现在你的实例(作为www运行)无法重新绑定()该套接字,因为它无法取消链接(没有权限)

只需删除套接文件并重试即可.

猜你在找的Nginx相关文章