<NME> rsted.fcgi
<BEF> #!/usr/bin/env python2

import os
from os.path import join as J
from pwl.fastcgi import runfastcgi
from application import app

full_run_path = J(app.config.root_path, app.config.get('RUN_PATH', 'var/run'))

if not os.path.isdir(full_run_path):
    os.mkdir(full_run_path)

# default options
fcgi_opts = {
    'daemonize': 'yes',
    'pidfile': os.path.join(run_path, 'fastcgi.pid'),
    'method': 'prefork',
    'socket': os.path.join(run_path, 'rsted.sock'),
}

run_as = app.config.get('RUN_AS')

run_as = app.config.get('RUN_AS')
if run_as:
    fcgi_opts['run_as'] = run_as

args=[]
runfastcgi(app, args, **fcgi_opts)

<MSG> [fcgi] specify workdir to root path

For valid work with launch from any dir

<DFF> @@ -16,6 +16,7 @@ fcgi_opts = {
     'pidfile': os.path.join(run_path, 'fastcgi.pid'),
     'method': 'prefork',
     'socket': os.path.join(run_path, 'rsted.sock'),
+    'workdir': app.config.root_path,
 }
 
 run_as = app.config.get('RUN_AS')

[fcgi] specify workdir to root path