I have a passenger_wsgi.py that's been working for years, and suddenly it fails. I have a custom python installation, but the .profile points to the right place, and the whole thing has not been altered in a very long time. Until today. Now everything is broken. It now insists on using /usr/bin/python no matter what, which causes all sorts of issues, and when I try to os.execl() over to my own python, it gives a server 500 error on the web, but works fine when I run passenger_wsgi.py on its own. That means it's the thing that's calling /usr/local/dh/passenger/lib/phusion_passenger/wsgi/request_handler.py itself, or that script itself (though the script claims to have not changed in several months).
import sys, os
if not re.match( "2.6.5", sys.version ):
os.execlp(home+"/local/bin/python2.6", "python2.6", *sys.argv)
os.environ['DJANGO_SETTINGS_MODULE'] = "XXX.settings"
application = django.core.handlers.wsgi.WSGIHandler()
Again, this worked just hunky-dory at very latest last Friday night at midnight, probably more recently. The passenger file is syntax-error-free and properly exec's to the proper python. The only thing I can think is that they suddenly decided to run request_handler.py as root rather than the local user. But if they changed that without telling anyone, WTF??? That would break anyone with a custom install, and not due to any ridiculous assumptions on the part of the custom installer.
I'm now pulling my hair out seeing if I can make it all run under FCGI instead, now that I can't find a way out of this myself...