[mod_python] Re: forks, daemons and other beasts

Daniel Nogradi nogradi at gmail.com
Sat Feb 11 17:02:19 EST 2006


> > Anyway, I have the feeling that there must be a more sane and probably
> > safe way of achieving what I would like by a much simpler method.
> >
> > Any ideas?
>
> A quick one.
>
> Run a small separate daemon process which embeds an  XML-RPC
> server and have your web pages use XML-RPC to call that daemon
> process to trigger off the task. The daemon process can still fork exec
> as necessary.
>
> This way you eliminate a fork in Apache child process which may be
> problematic because of the socket connections etc that are inherited.

Well, that still looks like to me that I'm shooting a bird with a
cannon. The reason is that I need to do something really simple: users
upload a zip file (remember my questions about the zipfile module? :))
and should get an acknowledgement that the upload was successful. The
server should start unpacking the archive, check if the files are okay
and move them to a directory. All of this can take quite long, so the
acknowledgement should be sent before this unpacking/checking/moving
finishes.

I slowly started to make peace with the idea that there will be a
separate script to handle the unpacking/checking/moving and all the
parameters will be passed as command line arguments using either exec*
or spawn*. This is not ideal because the nicely structured data in
classes have to be mapped to a long list of arguments. So if anyone
has a better idea, I'm still interested.



More information about the Mod_python mailing list