2009/3/18 Nimrod A. Abing <[email protected]>:
>
> I was looking at following section in the Wiki docs:
>
> http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Restarting_Daemon_Processes
>
> The code snippet in question is:
>
> if environ['mod_wsgi.process_group'] != '':
> import signal, os
> os.kill(os.getpid(), signal.SIGINT)
The 'environ' name here relates to the 'environ' argument passed to
the WSGI application. Ie., assumed that this code appears in context
where that was being passed through to it.
> using just plain "environ" raises NameError exception. Using
> "os.environ" raises KeyError exception. I would also like to note that
> the source for "monitor.py" found in the same section does not make
> use of the above code snippet.
Yes, that is correct, as in current versions of mod_wsgi there is no
way to determine outside context of a request, eg., as code triggered
by import, whether it is daemon mode process or not.
In mod_wsgi 3.0, plus going to be back ported to mod_wsgi 2.4, you
will be able to do:
import mod_wsgi
if mod_wsgi.process_group != '':
...
See:
http://code.google.com/p/modwsgi/issues/detail?id=27
> I am using the setup detailed here:
>
> http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html
>
> So I am quite sure I am running in daemon mode.
>
> Dumping os.environ I get the following keys:
>
> LANG,
> TZ,
> DJANGO_SETTINGS_MODULE,
> APACHE_RUN_USER,
> APACHE_PID_FILE,
> PWD,
> APACHE_RUN_GROUP,
> HOME,
> PATH
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---