From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85940 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Feature Request: Set Output Directory Date: Wed, 15 Jan 2014 11:00:29 +0100 Message-ID: <52D65C3D.4080609@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1389780036 12492 80.91.229.3 (15 Jan 2014 10:00:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 10:00:36 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 15 11:00:45 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W3NH9-0006pI-Ev for gctc-ntg-context-518@m.gmane.org; Wed, 15 Jan 2014 11:00:43 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 866A7101E8; Wed, 15 Jan 2014 11:00:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tcy-LB2QJ8H2; Wed, 15 Jan 2014 11:00:39 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4CA22101E3; Wed, 15 Jan 2014 11:00:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3C12A101E3 for ; Wed, 15 Jan 2014 11:00:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HCayfjBYik0S for ; Wed, 15 Jan 2014 11:00:35 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id 4CDA8101DE for ; Wed, 15 Jan 2014 11:00:35 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s0FA0XZ4011605 for ; Wed, 15 Jan 2014 11:00:34 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.103; Original-Received: from [10.100.1.103] (unverified [10.100.1.103]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 5285-1713362 for ; Wed, 15 Jan 2014 11:00:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=15; city=Zwolle; latitude=52.5058; longitude=6.0858; http://maps.google.com/maps?q=52.5058,6.0858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RLea0yff - a024be26d375 - 20140115 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85940 Archived-At: 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 ___________________________________________________________________________________