From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62463 Path: news.gmane.org!not-for-mail From: Florian Wobbe Newsgroups: gmane.comp.tex.context Subject: Re: calling ConTeXt as a background process Date: Fri, 08 Oct 2010 17:08:38 +0200 Message-ID: <90D46F76-AE5F-4A42-9FDC-8FAA3CE91EEF@awi.de> References: <4CAD8800.2010909@elvenkind.com> <4CAD8D8A.6040802@elvenkind.com> <5A1428AE-DA31-4120-9B35-102E7B42D8AC@fiee.net> <90F33E64-7BB9-4DEB-9E89-A4FC99169401@awi.de> <48470924-D44D-4010-B895-12EA664C4D90@fiee.net> <93934DF3-21F9-4F68-99B1-75A09A7835C8@fiee.net> <67380489-10BF-4A55-8519-5BC981426F3C@awi.de> <2F3F5D5C-FA78-4EA2-885E-A6DB86880B34@fiee.net> <95274FC9-42F1-4842-9943-103608507CB4@awi.de> <21C6E902-A3A4-4C4A-A9A0-2874DA107559@fiee.net> <6221687B-B252-4B09-BE36-4868261B78E1@awi.de> <2EDDB365-D3B3-448A-B854-55F768FA791D@fiee.net> <4CAF227D.3000703@elvenkind.com> <26119B9C-134E-4106-9EA9-06034A4DD083@fiee.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1286550555 4607 80.91.229.12 (8 Oct 2010 15:09:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Oct 2010 15:09:15 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Oct 08 17:09:05 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4EZD-0002dJ-SY for gctc-ntg-context-518@m.gmane.org; Fri, 08 Oct 2010 17:09:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 386ACCA6AA; Fri, 8 Oct 2010 17:09:03 +0200 (CEST) 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 u8FLeT3hZf9C; Fri, 8 Oct 2010 17:09:02 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3155ECA747; Fri, 8 Oct 2010 17:09:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7ECF7CA747 for ; Fri, 8 Oct 2010 17:08:58 +0200 (CEST) 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 GdAqOpFOjcf2 for ; Fri, 8 Oct 2010 17:08:47 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 26D09CA6AA for ; Fri, 8 Oct 2010 17:08:47 +0200 (CEST) Original-Received: from mails3.awi.de (mails3.AWI.DE [134.1.2.14]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o98F8jM3000995 for ; Fri, 8 Oct 2010 17:08:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by mails3.awi.de (Postfix) with ESMTP id BE85EA78A9 for ; Fri, 8 Oct 2010 17:08:44 +0200 (MEST) X-Virus-Scanned: amavisd-new at awi.de Original-Received: from localhost ([127.0.0.1]) by localhost (mails3.awi.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id KYyZrXiyCHWS for ; Fri, 8 Oct 2010 17:08:38 +0200 (MEST) Original-Received: from msg.awi.de (msg.AWI.DE [134.1.3.16]) by mails3.awi.de (Postfix) with ESMTP id B9F09A7873 for ; Fri, 8 Oct 2010 17:08:38 +0200 (MEST) Original-Received: from vpn-awinet-16-21.awi.de ([unknown] [172.28.16.21]) by msg.awi.de (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built Oct 15 2009)) with ESMTPSA id <0L9Z00DD78QERG00@msg.awi.de> for ntg-context@ntg.nl; Fri, 08 Oct 2010 17:08:38 +0200 (MEST) In-reply-to: <26119B9C-134E-4106-9EA9-06034A4DD083@fiee.net> X-Mailer: Apple Mail (2.1081) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=134.1.2.14; country=DE; region=03; city=Bremerhaven; latitude=53.5500; longitude=8.5833; http://maps.google.com/maps?q=53.5500,8.5833&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rDgf8JTJ - 537436448011 - 20101008 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62463 Archived-At: On Oct 8, 2010, at 16:30 , Henning Hraban Ramm wrote: > Am 2010-10-08 um 15:54 schrieb Taco Hoekwater: > >> On 10/08/2010 03:47 PM, Henning Hraban Ramm wrote: >>> >>> 16002 15978 TS 21 15:41 ? 00:00:01 \_ /var/www/xxx/bin/python >>> /var/www/.../manage.py run_gunicorn -c /var/www/.../gunicorn-settings.py >>> 16210 16002 TS 14 15:42 ? 00:00:08 \_ luatex --interaction=batchmode >>> --fmt=/var/opt/context/tex/texmf-cache/.../formats/cont-en >>> --lua=/var/opt/context/tex/texmf-cache/... >>> 16212 16210 TS 17 15:42 ? 00:00:00 \_ [uname] >> >> Hm, defunct, eh? >> >> The luatex binary itself definitely does not call uname as a >> process, therefore this has to be the os.resultof() function >> that Hans implements in l-os.lua. I am suspecting issues with >> redirection now, as that function is defined as: >> >> function os.resultof(command) >> local handle = io.popen(command,"r") >> return handle and handle:read("*all") or "" >> end The strange thing is that running luatex --interaction=batchmode --fmt=".../formats/cont-en" --lua=".../formats/cont-en.lui" --backend=pdf hello causes luatex (or say l-os.lua) to call 'uname -m' via os.resultof However, when doing mtxrun --script context --batchmode --once hello *only* texlua calls 'uname -m' and the following luatex child does *not* anymore. Why? >> of course this will fail/block rather horribly if uname -m >> does not write to STDOUT (and that is not just uname, thre >> are a few more uses of os.resultof()). if that is the case you should not see any reads after the child forks: clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7feb7a0369d0) = 14998 [...] read(3, "x86_64\n", 4096) = 7 read(3, "", 4096) = 0 --- SIGCHLD (Child exited) @ 0 (0) --- > My script now calls first os.uname and then the external one. > From the shell it works like expected. > And even from the server process! That alone doesn't seem to be the problem. > > Here's the trace: > > strace -ff texlua call_uname.lua > > [...] I'm running out of ideas. From your script os.resultof("uname -m") works and from luatex it doesn't. What does this trace distinguish from the one of luatex? Florian ___________________________________________________________________________________ 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 ___________________________________________________________________________________