Hi all,

I can't work out why a cgi script which fires off latex to process a
file in /tmp does not seem to be able to write the dvi file or its log
file. The application creates a file called 192.168.1.4.tex fine.
But latex won't run on it from the cgi script.

This is the command I am using in perl:
system("date > /tmp/chemlabel.log; latex $latex_file >> /tmp/chemlabel.log") && \
die "can't run latex on $latex_file !"; 

The apache error log says
    can't run latex on /tmp/192.168.1.4.tex !
so that comes from the die statement and shows that its getting the 
right filename and 192.168.1.4.tex is being created.

after running this cgi script FROM my web application
/tmp$ ls -l
total 23
-rw-r--r--    1 www-data www-data      288 Oct 31 17:40 192.168.1.4.tex
-rw-r--r--    1 www-data www-data      195 Oct 31 17:40 chemlabel.log

you can see that the output of the attempt to run latex on the file is
in chemlabel.log

/tmp$ cat chemlabel.log 
Wed Oct 31 17:40:43 EST 2001
This is TeX, Version 3.14159 (Web2C 7.3.1)
! I can't write on file `192.168.1.4.log'.
Please type another transcript file name: 
! Emergency stop
No pages of output.


OK so it seems like latex running as user www-data can't write its log
file 192.168.4.log etc. 
If I su to www-data from root so that I am that user then I can run
latex on the file quite OK as you can see here:

/tmp$ latex 192.168.1.4.tex       <-- note I am user: www-data now
This is TeX, Version 3.14159 (Web2C 7.3.1)
(192.168.1.4.tex
LaTeX2e <1998/12/01> patch level 1
....
Output written on 192.168.1.4.dvi (1 page, 292 bytes).
Transcript written on 192.168.1.4.log.


Now an ls -l shows...

-rw-r--r--    1 www-data www-data        8 Oct 31 17:43 192.168.1.4.aux
-rw-r--r--    1 www-data www-data      292 Oct 31 17:43 192.168.1.4.dvi
-rw-r--r--    1 www-data www-data     2304 Oct 31 17:43 192.168.1.4.log
-rw-r--r--    1 www-data www-data      288 Oct 31 17:40 192.168.1.4.tex
-rw-r--r--    1 www-data www-data      195 Oct 31 17:40 chemlabel.log

viewing the dvi file shows its all ok and as expected www-data was able
to write the log file and the dvi file .

But agian if I try to run it from the web browser firing off the cgi
script then the chemlabel.log file shows a new date (which means it is
being written to ok) but that mesasage that latex can't write on
192.168.1.4.log

But www-data owns the file and should be able to write to it.
-rw-r--r--    1 www-data www-data     2304 Oct 31 17:43 192.168.1.4.log

At a loss.

Mike
-- 
--------------------------------------------------------------------
Michael Lake
Active caver, Linux enthusiast and interested in anything technical.
Safety Convenor, Australian Speleological Federation
Owner, Speleonics (Australia)  <^~^::^~^>
--------------------------------------------------------------------

-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to