2

Run django project using uwsgi + supervisor.
We use pyuno for generating documents with LibreOffice.

Uwsgi config:

[uwsgi]
virtualenv = /var/www/myuser/.Envs/j297/
vacuum = True
chdir = /var/www/myuser/j297/twotbank/
socket = /var/www/myuser/j297/uwsgi/uwsgi.sock
chmod-socket = 777
LANG = en_US.UTF-8
py-auto-reload = 3
enable-threads = true

pythonpath=..
plugins = python
module = wsgi

master = true
processes = 4
max-requests = 5000
buffer-size = 32768
post-buffering-bufsize = 65536

touch-reload=/tmp/j297

Supervisor config:

[program:j297]
command=/usr/bin/uwsgi --ini /var/www/myuser/j297/uwsgi/uwsgi.ini
directory=/var/www/myuser/
user=myuser
numprocs=1
autostart=true
autorestart=true
redirect_stderr=true
stopwaitsecs = 60
stopsignal=INT

[program:libre]
command = /usr/lib/libreoffice/program/soffice.bin "--accept=socket,host=127.0.0.1,port=9000,tcpNoDelay=1;urp;StarOffice.ServiceManager" --headless --nodefault --nofirststartwizard --nolockcheck --nologo --norestore
stdout_logfile= /var/log/libreoffice.log
redirect_stderr= true
autostart= true

My problem is as follows:
Pyuno crashed with error:

Error during bootstrapping uno (RuntimeException):cannot open file:///root/.ure/types.rdb

But if I run uwsgi manually from the console under the user 'myuser', from same directory like in supervisor. All works and no make errors.

uwsgi - 2.0.2
LibreOffice 3.5
supervisor 3.0
Python 2.7.3

Many thanks in advance.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
WebPal
  • 818
  • 8
  • 16
  • 1
    Is it possible your code rely on the $HOME environment variable ? Try setting it in the same way you set LANG – roberto Mar 06 '14 at 05:22

0 Answers0