in reply to Re^5: mod_perl, prefork mpm and alarms
in thread mod_perl, prefork mpm and alarms

I owe you a beer. You're absolutely right .. the code that I'm calling does do some futzing around with pipes to call Ghostscript .. it's not my code, I'm just calling it, but I should have guessed (or even checked) that there were pipes involved.

And that's not on .. Apache has taken control of the input and output pipes in the main process .. meaning if I want to do something *like* that, I have to start a sub-process and talk to it directly. So Apache was burping when it saw the code I was calling start to rearrange the plumbing, I guess.

Well, it's going to get tricky later when I want to start a sub-process if one isn't yet running for a document, use it for a page image, and then leave it in place for subsequent requests for the same document.

But Momma, that's where the fun is! --Manfred Mann

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^7: mod_perl, prefork mpm and alarms
by perrin (Chancellor) on Nov 29, 2006 at 21:16 UTC
    STDIN and STDOUT are tied under mod_perl, but you should be able to open pipes to another process. Usually, the best way to handle this kind of thing is a separate job queue process, as suggested by some others.

      Just posting here for sake of completeness .. after plugging Log::Log4perl in various places, I discovered the fatal error was

      Can't locate object method "FILENO" via package "Apache::RequestRec" at /usr/lib/perl5/5.8.0/IPC/Open3.pm line 196

      So that means I need to figure out how to solve that problem .. but at least I know what problem I'm trying to solve now.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        I think you just need to untie STDIN. See this thread for examples.