Angus Lees wrote:
>
> On Tue, Mar 13, 2001 at 09:42:48AM -0500, Neil Gunton wrote:
> > But it doesn't seem to affect the main problem of the spawn
> > failing. This is a real corker. I wonder what else is different when
> > we are running under Apache/mod_perl? I guess it could still be a
> > stdin problem, you mentioned that the < /dev/null redirection is not
> > exactly the same. I am stumped.
>
> try "strace -f -p <process id>" on the running apache/mod_perl process.
Thanks Gus. I think I have found the problem - it is a generic one for
mod_perl scripts spawning other processes. You need to be really careful
about it; there is a whole section on spawning in the mod_perl
performance tuning doc, and a mention in the mod_perl traps doc. I
contacted the author of Lingua::Ispell and he doesn't have any
experience using mod_perl, though he did confirm someone else having the
same kind of problem that I am having (but no resolution). Since he is
apparently unaware of mod_perl spawning issues, I doubt that
Lingua::Ispell is "mod_perl safe" as it stands.
At this point I am thinking about writing a separate daemon wrapper for
Lingua::Ispell which I will communicate with from Embperl using sockets.
This may be the best solution, given the apparent issues with spawning
processes from mod_perl. If this works then I will pass the code back to
the author of Lingua::Ispell, because I imagine that I am not the first
person to want to do trivial spell checking from mod_perl/Embperl
scripts... hopefully what I can end up with is a simple method call,
passing in a string and getting back a list of bad words (or, perhaps,
the same string with bad words marked up somehow, e.g. in HTML). And if
I make the daemon pre-forking (i.e. able to efficiently handle multiple
requests in parallel, like apache) then it could be quite useful in a
web server environment. Plus, for busy websites you could put the
spellcheck server on its own machine, load balance etc.
Thanks again
-Neil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]