uWSGI服务器日志...权限被拒绝读取文件...哪个文件? [英] uWSGI Server log…permission denied to read file...which file?

查看:1517
本文介绍了uWSGI服务器日志...权限被拒绝读取文件...哪个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台运行Django / Nginx / uWSGI的服务器,在皇帝模式下使用uWSGI,并且它的错误日志(vassal级错误日志,而不是皇帝级日志)每次产生一个持续的权限错误新员工,如下所示:


Tue Jun 26 19:34:55 2012 - 重新启动uWSGI worker 2(new pid:9334)



错误打开文件阅读:权限被拒绝


问题是,不知道什么文件打开麻烦?这不是日志文件,显然,因为我正在看它,它的写作没有问题。有什么办法找出来?我在Ubuntu 12.04上通过Upstart运行apt-get版本的uWSGI 1.0.3-debian。该网站正在成功工作,除了似乎是一个内存泄漏外,所以我看日志文件。我已经尝试更改整个/ opt /目录的权限以包含uwsgiuser用户,无济于事。我使用TCP套接字,所以权限不应该是一个问题。是缓存吗?这是否具有自己的权限?如果是,在哪里?

 我的Upstart conf文件

描述uWSGI在runlevel上启动[2345 ] stop on runlevel [06] respawn

env UWSGI = / usr / bin / uwsgi env LOGTO = / var / log / uwsgi / emperor.log

exec $ UWSGI \\ \\
--master \
--emperor / etc / uwsgi / vassals \
--die-on-term \
--auto-procname \
- 无孤儿\
--logto $ LOGTO \
--logdate

我的Vassal ini文件:

  [uwsgi] 
#变量
base = / opt / env / mysiteenv

#Generic Config
uid = uwsgiuser
gid = uwsgiuser
socket = 127.0.0.1:5050
master = true
processes = 2
reload-on-as = 128
harakiri = 60
harakiri-verbose = true
auto-procname = true
plugins = http ,python
cache = 2000
home =%(base)
pythonpath =%(base)/ mysite
module = wsgi
logto = / opt / log / mysite /error.log
logdate = true


解决方案

这个问题的实际答案似乎是这个Ubuntu特定的错误:



https://bugs.launchpad.net/ubuntu/+source/libjpeg-turbo / + bug / 1031718



您可以通过将行



<$ p $来解决问题p> setuid uwsgiuser
setgid uwsgiuser

进入您的启动配置文件,并从uwsgi配置中删除 uid gid 设置。


I have a server running Django/Nginx/uWSGI with uWSGI in emperor mode, and the error log for it (the vassal-level error log, not the emperor-level log) has a continual permissions error every time it spawns a new worker, like so:

Tue Jun 26 19:34:55 2012 - Respawned uWSGI worker 2 (new pid: 9334)

Error opening file for reading: Permission denied

Problem is, I don't know what file it's having trouble opening; it's not the log file, obviously, since I'm looking at it and it's writing to that without issue. Any way to find out? I'm running the apt-get version of uWSGI 1.0.3-debian through Upstart on Ubuntu 12.04. The site is working successfully, aside from what seems like a memory leak...hence my looking at the log file. I've experimented with changing the permissions of the entire /opt/ directory to include the uwsgiuser user, to no avail. I'm using a TCP socket, so permissions shouldn't be an issue there. Is it the cache? Does that have its' own permissions? If so, where?

My Upstart conf file

description "uWSGI" start on runlevel [2345] stop on runlevel [06] respawn

env UWSGI=/usr/bin/uwsgi env LOGTO=/var/log/uwsgi/emperor.log

exec $UWSGI \
--master \
--emperor /etc/uwsgi/vassals \
--die-on-term \
--auto-procname \
--no-orphans \
--logto $LOGTO \
--logdate

My Vassal ini file:

[uwsgi]
# Variables
base = /opt/env/mysiteenv

# Generic Config
uid = uwsgiuser
gid = uwsgiuser
socket = 127.0.0.1:5050
master = true
processes = 2
reload-on-as = 128
harakiri = 60
harakiri-verbose = true
auto-procname = true
plugins = http,python
cache = 2000
home = %(base)
pythonpath = %(base)/mysite
module = wsgi
logto = /opt/log/mysite/error.log
logdate = true

解决方案

The actual answer to this question appears to be this Ubuntu-specific bug:

https://bugs.launchpad.net/ubuntu/+source/libjpeg-turbo/+bug/1031718

You can work around the problem by putting the lines

setuid uwsgiuser
setgid uwsgiuser

into your upstart configuration file, and deleting the uid and gid settings from your uwsgi configuration.

这篇关于uWSGI服务器日志...权限被拒绝读取文件...哪个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆