On 1/13/2014 4:24 AM, Thangalin wrote:

Summary: If the --result parameter includes a path then ConTeXt should
assume that that directory is writable thus read/write its temporary
flies at that location instead of the current working directory (CWD).

Consider the following three accounts:

- ConTeXt installation account (e.g., "context")
- Web server account (e.g., "web")
- Application account (e.g., "app")

ConTeXt is run using the web server account. The web server's CWD is
set to the application directory. For security reasons, the "web"
account may not create files in the "app" account.

When ConTeXt is called by the "web" account, the CWD is an "app"
account subdirectory. This subdirectory contains scores of .tex input
files that control various themes for the final rendered document.
Many different users, through this web-based application, create
different content .tex files.

I would like to run context as the web user within the app directory,
where the input .tex files are located; effectively, as the "web"
account, this would look like:

   cd /home/app/public_html/book/context
   source /home/context/bin/context/tex/setuptex
/home/web/users/1/book.tex --result=/home/web/users/1/book.pdf

Since the "web" account cannot write to the "app" directory, this
causes the following error:

! I can't write on file `book.log'.

The following is also not possible as the "web" account:

   cd /home/web/users/1/
   source /home/context/bin/context/tex/setuptex
   /home/context/bin/context/tex/texmf-linux-64/bin/context book.tex

This fails because the book.tex file includes files that are in the
"app" directory, which cannot be found. Since the "book.tex" file will
be in a different directory for every user, a symbolic link in each
book directory would probably resolve the issue, but that's a bit

I have updated TEXMFCACHE in texmfcnf.lua to point to
/var/cache/context/texmf-cache/ (world-writable), but it didn't help.

It seems that ConTeXt assumes write permissions to the current working
directory, which is not a valid assumption.


in such case we create a temporary path (that is, the web service does that) and run context in a different way, say

mtxrun --path=/data/work/tmp --script context --path=/data/resources/mine ....

so, you will run on /data/work/tmp and input files will also be looked up opn /data/resources/mine


                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net

Reply via email to