bgprior has asked for the wisdom of the Perl Monks concerning the following question:
One of the jobs I am trying to script is regenerating the whole manual when method statements/procedures have been reissued. I can generate a LyX file with embedded references to all the other LyX files (around 200 of them). Then I want to run "lyx -e latex" against this file to generate LaTeX files to run pdflatex and latex2html against to recreate a PDF and web-site of the whole system.
This works manually. And it works if I run a perl-script from the command-line that calls these commands. But if I try to call the script from a web browser, "lyx -e latex" stalls and the script never returns. I have to kill -9 the lyx process to get rid of the script process.
I don't think it's an ownership/permissions issue. I have created a minimal script that just chdir's to the relevant directory, and then calls lyx -e latex against the relevant file. I can su to the user that apache runs as and call the script, and it runs fine. But if I call the identical script from the browser, it stalls as described. I think the above also indicates it's not a tainting issue (everything is hardcoded - no parameters are passed in this stripped-down script).
I have tried the various ways of calling lyx (backticks, system with list, system with whole command passed as single parameter, fork + exec) and it doesn't make any difference. I have tried calling lyx.bin instead of lyx (which is just a shell wrapper on my system). Of course, I use full paths for the binary and file.
There is no problem if the file called does not contain many embedded files. The problem started when the number of embedded files reached a critical point.
When you run lyx -e latex against a LyX file containing references to embedded files, it seems to run the command against the embedded files as well as the main file. I can tell from looking at the file modification times exactly where the script stalled. It processes around 30 embedded files before stalling. I can run lyx -e latex against the last file to be processed, or any of the succeeding ones without problem, so I don't think it's problems with the individual files.
I am suspicious that it runs out of resources of some sort, but I have no idea what resource constraints there might be on perl called from a CGI-script (not mod_perl) that didn't apply to perl called from the command line.
Sorry for the long explanation, but I wanted to get all the facts in. Does anyone have any ideas why "lyx -e latex" on a file with many embedded children would stall when called from a perl CGI-script? Thanks, Bruno
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling "lyx -e latex" from perl CGI-script
by sgifford (Prior) on Jul 03, 2003 at 05:59 UTC | |
|
Re: Calling "lyx -e latex" from perl CGI-script
by tilly (Archbishop) on Jul 03, 2003 at 04:58 UTC | |
by bgp (Initiate) on Jul 07, 2003 at 12:30 UTC | |
by tilly (Archbishop) on Jul 07, 2003 at 23:22 UTC | |
|
Re: Calling "lyx -e latex" from perl CGI-script
by fglock (Vicar) on Jul 03, 2003 at 01:25 UTC | |
by bgp (Initiate) on Jul 07, 2003 at 12:22 UTC |