From: Florian Wobbe <Florian.Wobbe@awi.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: calling ConTeXt as a background process
Date: Fri, 08 Oct 2010 17:08:38 +0200 [thread overview]
Message-ID: <90D46F76-AE5F-4A42-9FDC-8FAA3CE91EEF@awi.de> (raw)
In-Reply-To: <26119B9C-134E-4106-9EA9-06034A4DD083@fiee.net>
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] <defunct>
>>
>> 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
___________________________________________________________________________________
next prev parent reply other threads:[~2010-10-08 15:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 7:06 Henning Hraban Ramm
2010-10-07 7:34 ` Henning Hraban Ramm
2010-10-07 8:42 ` Taco Hoekwater
2010-10-07 9:00 ` Henning Hraban Ramm
2010-10-07 9:06 ` Taco Hoekwater
2010-10-07 10:19 ` Henning Hraban Ramm
[not found] ` <90F33E64-7BB9-4DEB-9E89-A4FC99169401@awi.de>
2010-10-07 15:55 ` Henning Hraban Ramm
2010-10-07 16:32 ` Florian Wobbe
2010-10-08 7:36 ` Henning Hraban Ramm
2010-10-08 7:59 ` Florian Wobbe
2010-10-08 8:43 ` Henning Hraban Ramm
2010-10-08 9:25 ` Florian Wobbe
2010-10-08 10:00 ` Henning Hraban Ramm
2010-10-08 11:46 ` Florian Wobbe
2010-10-08 13:47 ` Henning Hraban Ramm
2010-10-08 13:54 ` luigi scarso
2010-10-08 13:54 ` Taco Hoekwater
2010-10-08 14:22 ` Patrick Gundlach
2010-10-08 14:30 ` Henning Hraban Ramm
2010-10-08 14:57 ` Taco Hoekwater
2010-10-08 15:10 ` Hans Hagen
2010-10-08 15:08 ` Florian Wobbe [this message]
2010-10-08 19:44 ` calling ConTeXt as a background process (SOLVED) Henning Hraban Ramm
2010-10-10 8:47 ` Patrick Gundlach
2010-10-10 9:01 ` Henning Hraban Ramm
2010-10-26 19:28 ` Taco Hoekwater
2010-10-26 20:09 ` Hans Hagen
2010-10-26 20:56 ` Taco Hoekwater
2010-10-26 21:32 ` Hans Hagen
2010-10-26 20:13 ` Henning Hraban Ramm
2010-10-08 15:05 ` calling ConTeXt as a background process Henning Hraban Ramm
2010-10-07 18:16 ` taco
2010-10-08 8:00 ` Henning Hraban Ramm
2010-10-08 8:12 ` Patrick Gundlach
2010-10-08 9:21 ` Henning Hraban Ramm
2010-10-08 9:27 ` luigi scarso
2010-10-08 8:37 ` luigi scarso
2010-10-08 8:47 ` Henning Hraban Ramm
2010-10-08 8:54 ` luigi scarso
2010-10-08 10:19 ` Hans Hagen
2010-10-07 10:16 ` Robin.Kirkham
2010-10-07 11:02 ` Henning Hraban Ramm
2010-10-07 10:27 ` Patrick Gundlach
2010-10-07 15:44 ` Henning Hraban Ramm
2010-10-07 15:48 ` luigi scarso
2010-10-07 16:15 ` Henning Hraban Ramm
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=90D46F76-AE5F-4A42-9FDC-8FAA3CE91EEF@awi.de \
--to=florian.wobbe@awi.de \
--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).