0

I'm trying to generate PDF file from Latex template. I've done it in development environment (running python manage.py straight from eclipse)... but I can't make it work into the server, which is running using cherokee and uwsgi.

We have realized that open(filename) creates a file owning to root (also root group). This isn't taking place in development environment... but the most strange thing about this issue is that somewhere else in our code we are creating a text file (latex uses is a text file too), but it's created with the user cherokee is supposed to use, not root!

What happened? How can we fix it?

We are running this code on ubuntu linux and a virtual environment both in development and production.

We started following some instructions to do it using python's temporary file and folder creation functions, but we thought that it could be something related with them, and created them "manually" in order to try to solve this issue... but it didn't work.

  • And, of course, we've installed all the necessary packages (and proved it work) on the servers. – user3052958 Dec 26 '15 at 11:56
  • Can you show how you're starting server and your uWSGI config file (if any)? – GwynBleidD Dec 28 '15 at 19:04
  • I've managed to know what happens with this issue. It has nothing to do with uwsgi at all, but with supervisord instead. Supervisord is executing with a user that does not exist and because of this it's changing to user root when trying to run the latexpdf command. I've changed the executing user into supervisord's config file, but it seems not to accept this change. Something very estrange, isn't it? – user3052958 Dec 31 '15 at 10:07
  • Note: latexpdf is called in a subprocess which is executed within a celery process, for speed purposes. – user3052958 Dec 31 '15 at 10:09

1 Answers1

0

As I've said in my comments this issue was related to supervisord. I've solved it assigning the right path and user into "environment" variable of supervisord's config file.