Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 436202 - www-servers/uwsgi-1.2.6 - init.d script should use --file instead of --fileserve-mode
Summary: www-servers/uwsgi-1.2.6 - init.d script should use --file instead of --filese...
Status: RESOLVED DUPLICATE of bug 416959
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ultrabug
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-25 11:52 UTC by El Goretto
Modified: 2012-10-31 15:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description El Goretto 2012-09-25 11:52:40 UTC
Hi,

Trying to understand why I couldn't succesfully upgrade mumble-django app with uwsgi from 1.0.x to 1.2.x (Got "no app loaded" in logs followed by "uwsgi error / Python application not found" in a browser), I tracked it down to the 1.2 init-script being damn wrong: it would totally ignore .wsgi file argument passed to it.
Line 81:
if [ -n "${UWSGI_PROGRAM}" ]; then
                OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
fi

--fileserve-mode is not the correct option, but --file or --wsgi-file (as in 1.0.x init-script).

Fun fact is that --file (fix I used) and --wsgi-file options are actually absent of uwsgi --help text.
Comment 1 Ultrabug gentoo-dev 2012-10-29 18:52:47 UTC
Hi El Goretto,

Actually the --file and --wsgi-file are present in the --help only if you load the python plugin *before* calling them (it's tricky I know).

For example consider the output of the two commands :
# uwsgi --help | grep file

vs

# uwsgi --plugins=python27 --help | grep file

As the init script must be right for all plugins use cases, we couldn't rely on the fact that the python one would always be called, that's why we have to use the --fileserve-mode option.

In your case, you have to set this in the UWSGI_EXTRA_OPTIONS parameter of the conf.d/uwsgi file. Something like "--plugins=python27 --file /path/to/your/file.py"

Hope that is clear and helps ? Keep me posted plz.

Cheers
Comment 2 El Goretto 2012-10-30 13:26:53 UTC
Owwwwww, I see.

I'm totally not skilled in uwsgi area. Ok, then --wsgi-file is only used with python plugin.
[snip]
You mean that depending of the plugin/language loaded, the keyword pointing to uwsgi app ($UWSGI_PROGRAM) is different (only used python so far)?

I still don't understand (in init script) how --fileserve-mode is related to $UWSGI_PROGRAM var, since documentation reads that fileserve-mode parameters are:
*x-sendfile -> will use the X-Sendfile header (apache, Cherokee, lighttpd)
*x-accel-redirect -> will use the X-Accel-Redirect header (nginx)
*default -> sendfile()
Or the $UWSGI_PROGRAM is definitly not what I think it is (the uwsgi app file).

Regards.
Comment 3 Ultrabug gentoo-dev 2012-10-30 14:32:37 UTC
(In reply to comment #2)
> Owwwwww, I see.
> 
> I'm totally not skilled in uwsgi area. Ok, then --wsgi-file is only used
> with python plugin.
> [snip]
> You mean that depending of the plugin/language loaded, the keyword pointing
> to uwsgi app ($UWSGI_PROGRAM) is different (only used python so far)?
> 
> I still don't understand (in init script) how --fileserve-mode is related to
> $UWSGI_PROGRAM var, since documentation reads that fileserve-mode parameters
> are:
> *x-sendfile -> will use the X-Sendfile header (apache, Cherokee, lighttpd)
> *x-accel-redirect -> will use the X-Accel-Redirect header (nginx)
> *default -> sendfile()
> Or the $UWSGI_PROGRAM is definitly not what I think it is (the uwsgi app
> file).
> 
> Regards.

I'm sure that bug #416959 will enlighten you on this matter [1]. This issue has already been discussed there. If not, don't hesitate to say so.

[1] https://bugs.gentoo.org/show_bug.cgi?id=416959
Comment 4 Ultrabug gentoo-dev 2012-10-31 15:12:54 UTC

*** This bug has been marked as a duplicate of bug 416959 ***