Communication between a Python process and a Python cgi script
Maciej Sobczak
maciej at maciejsobczak.com
Thu Apr 11 17:48:05 EDT 2002
Hi,
"Joonas Paalasmaa" <joonas at olen.to> wrote in message
news:3CB5E224.4E3DC5BA at olen.to...
> I have a Python program started by root that does some magic stuff
> every 10 minutes. So the program in an infinite loop of sleep, do stuff,
> sleep, do stuff... How can I make a cgi-script to end the process's
> sleep phase and make it to "do stuff" immediately.
For this kind of interprocess communication, you can try
http://www.maciejsobczak.com/prog/yami/
and in particular:
http://www.maciejsobczak.com/prog/yami/impl/index.html#python
It can be used not only for communication, but also for synchronization.
> I tried signals, but
> it is propably too risky because the process is run as root. Any
> suggestions?
It's rather hard to come up with a scheme that will be really safe here.
FIFO with rights properly set up would probably do, but this adds some
complexity.
Cheers,
--
Maciej Sobczak
http://www.maciejsobczak.com/
More information about the Python-list
mailing list