Apache v2.4.12-2
Mod_wsgi v4.4.8-1
Python v3.4.2
python-flask v0.10.1-5
Arch linux - kernel 3.12.36
I use mod_wsgi and flask to host the server. I can reproduce this problem with the following simplified code and a generic .wsgi script:
MainServer.py:
import flask
app = flask.Flask(__name__)
@app.before_first_request
def initstuff():
test_file = '/tmp/test'
with open(test_file, 'w') as f:
f.write('test')
@app.route('/', methods=['GET'])
def rootdir():
return 'Hello world'
MainServer.wsgi:
from MainServer import app as application
Expected: a file with the contents of 'test' is written to / tmp
Actual result: the file is not written. Errors not reported in the log
If I run the same code, but instead point to any other directory that my user has write permission to, it creates the file as expected. / tmp is the only directory in which I have this problem.
, (app.run), /tmp, , - .
, mod_wsgi , script app.run, /tmp.
- -
httpd . httpd systemd