ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Feature Request: Set Output Directory
Date: Wed, 15 Jan 2014 11:00:29 +0100	[thread overview]
Message-ID: <52D65C3D.4080609@wxs.nl> (raw)
In-Reply-To: <CAANrE7qcRZsN7FDGd4O5_iThc6gkNZ--CfYG3=fBidEiXKwSug@mail.gmail.com>

On 1/13/2014 4:24 AM, Thangalin wrote:
> Hi,
>
> 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/context/bin/context/tex/texmf-linux-64/bin/context
> /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
> wasteful.
>
> 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.
>
> Thoughts?

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

-----------------------------------------------------------------
                                           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 Wiki!

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	other threads:[~2014-01-15 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13  3:24 Thangalin
2014-01-15 10:00 ` Hans Hagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52D65C3D.4080609@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).