Re: [NTG-context] calling ConTeXt as a background process
Am 2010-10-07 um 12:54 schrieb Florian Wobbe:
On Oct 7, 2010, at 12:19 , Henning Hraban Ramm wrote:
Am 2010-10-07 um 11:06 schrieb Taco Hoekwater:
Of course, prd_paket.tex is my input file. But that's there.
Your shell quotes were off. It is looking for
"./prd_paket --batchmode --once.tex"
Ok, but it doesn't work with any other call of luatex - I also tried to start another shell script that calls luatex, but it hangs in the same manner. If I kill the luatex process, further commands work.
could you send me the calling shell script along with all necessary files to run the context batch? or supply a minimal example instead of prd_paket.tex.
Hi Florian, it doesn't depend on the tex file, it's the same with \starttext Hello World! \stoptext It also doesn't depend on context options (--batchmode etc.) And it doesn't seem to depend on the way of calling it from Python/ Django: - directly with subprocess.Popen (several options), subprocess.call, subprocess.check_call - indirectly via shell script (that contains just the context call) - with context or mtxrun (didn't try texlua directly yet) - with setuptex or setting TEXROOT and TEXMFOS directly (in the environment for the subprocess call) I can imagine that it has something to do with SElinux settings, didn't dive in that yet. I can call context manually as the same user that's running the server process with all the options. It also works on my test system (osx-intel) with Django's dev server, just not on my Ubuntu server (linux-64). Despairing greetlings, Hraban
Am 2010-10-07 um 12:54 schrieb Florian Wobbe:
On Oct 7, 2010, at 12:19 , Henning Hraban Ramm wrote:
Am 2010-10-07 um 11:06 schrieb Taco Hoekwater:
Of course, prd_paket.tex is my input file. But that's there.
Your shell quotes were off. It is looking for
"./prd_paket --batchmode --once.tex"
Ok, but it doesn't work with any other call of luatex - I also tried to start another shell script that calls luatex, but it hangs in the same manner. If I kill the luatex process, further commands work.
could you send me the calling shell script along with all necessary files to run the context batch? or supply a minimal example instead of prd_paket.tex.
Hi Florian,
it doesn't depend on the tex file, it's the same with
\starttext Hello World! \stoptext
It also doesn't depend on context options (--batchmode etc.)
And it doesn't seem to depend on the way of calling it from Python/Django: - directly with subprocess.Popen (several options), subprocess.call, subprocess.check_call - indirectly via shell script (that contains just the context call) - with context or mtxrun (didn't try texlua directly yet) - with setuptex or setting TEXROOT and TEXMFOS directly (in the environment for the subprocess call)
I can imagine that it has something to do with SElinux settings, didn't dive in that yet.
I can call context manually as the same user that's running the server process with all the options.
It also works on my test system (osx-intel) with Django's dev server, just not on my Ubuntu server (linux-64).
Well, remote sensing with computers is cumbersome and as I haven't got a clue what happens on your machine I'd rather see your the shell script. How is this script intended to be called: as a subshell from the prompt, as a cron job in the background, ...? I've got Ubunto and OSX here and could try to reproduce the error for you, if you post your script. A shell script with just these 4 lines #!/bin/bash cd $HOME/context/tests export PATH=$PATH:$HOME/applic/context/tex/texmf-linux-64/bin context --batchmode test.tex works as expected on Ubunto 2.6.32-24-server x86_64 with an almost empty environment (none of the TEX* variables set). You just have to set the path to context - nothing else is necessary. As for the environment variables set: you can test for that in the script via 'env' and redirect the output to a file. Cheers, Florian
Am 2010-10-07 um 18:32 schrieb Florian Wobbe:
Well, remote sensing with computers is cumbersome and as I haven't got a clue what happens on your machine I'd rather see your the shell script.
Don't keep fixed on that shell script - it was only one of many failed attempts. "context" itself is only a shell script that calls mtxrun. It doesn't matter how I call ConTeXt from the server process - it hangs at texlua.
How is this script intended to be called: as a subshell from the prompt, as a cron job in the background, ...?
At the end I want to run it via Celery/RabbitMQ (an AMQP message queue), but since that's another complication, I tried first to run it directly from my Django view (in other framework's talk that's the controller).
I've got Ubunto and OSX here and could try to reproduce the error for you, if you post your script.
Thank you, but the problem is most probably something in my server setup that doesn't fit something in LuaTeX. As I mentioned: I got no problems calling TeX directly, just from the server process.
A shell script with just these 4 lines
#!/bin/bash cd $HOME/context/tests export PATH=$PATH:$HOME/applic/context/tex/texmf-linux-64/bin context --batchmode test.tex
works as expected on Ubunto 2.6.32-24-server x86_64 with an almost empty environment (none of the TEX* variables set). You just have to set the path to context - nothing else is necessary.
As for the environment variables set: you can test for that in the script via 'env' and redirect the output to a file.
Guess what I tested before complaining. I redirect the whole process output to a log file, unfortunately I catch no message from TeX whatsoever, e.g. with "set && date && context hello" I get the env settings and the date, but no message from context. I'll write a summary. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Oct 8, 2010, at 09:36 , Henning Hraban Ramm wrote:
I've got Ubunto and OSX here and could try to reproduce the error for you, if you post your script.
Thank you, but the problem is most probably something in my server setup that doesn't fit something in LuaTeX. As I mentioned: I got no problems calling TeX directly, just from the server process.
All right. I have one more suggestion. If you don't want to dive into debugging via gdb you should try another attempt at strace. Previously you posted a tracedump of context. But it only shows context (the shell script) waiting and nothing related to luatex. You may want to make strace follow forks (-f). Florian
Am 2010-10-08 um 09:59 schrieb Florian Wobbe:
Thank you, but the problem is most probably something in my server setup that doesn't fit something in LuaTeX. As I mentioned: I got no problems calling TeX directly, just from the server process.
All right. I have one more suggestion. If you don't want to dive into debugging via gdb you should try another attempt at strace. Previously you posted a tracedump of context. But it only shows context (the shell script) waiting and nothing related to luatex. You may want to make strace follow forks (-f).
Sorry, I've no experience using strace. Here we are:
This is how my process tree looked:
14025 ? Sl 0:01 | \_ /var/www/xxx/bin/python /var/
www/xxx/.../manage.py runfcgi ...
14116 ? S 0:00 | \_ /bin/sh -c set >>
_context.log && strace -f context --batchmode --once hello >>
_context.log
14117 ? S 0:00 | \_ strace -f context --
batchmode --once hello
14118 ? T 0:00 | \_ /bin/sh /var/opt/
context/tex/texmf-linux-64/bin/context --batchmode --once hello
14119 ? R 0:11 | \_ texlua /var/opt/
context/tex/texmf-linux-64/bin/mtxrun --script context --batchmode --
once hello
The logfile was empty, texlua seemed to hang. I killed 14119 and got:
execve("/var/opt/context/tex/texmf-linux-64/bin/context", ["context",
"--batchmode", "--once", "hello"], [/* 10 vars */]) = 0
brk(0) = 0x8e2e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b08959ac000
uname({sys="Linux", node="aine.fiee.net", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b08959ad000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=20573, ...}) = 0
mmap(NULL, 20573, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b08959af000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libncurses.so.5", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320%
\1\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=256288, ...}) = 0
mmap(NULL, 2353152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x2b0895bad000
mprotect(0x2b0895be8000, 2093056, PROT_NONE) = 0
mmap(0x2b0895de7000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_FIXED|MAP_DENYWRITE, 3, 0x3a000) = 0x2b0895de7000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>
\0\1\0\0\0\20\16\0\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14616, ...}) = 0
mmap(NULL, 2109728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x2b0895dec000
mprotect(0x2b0895dee000, 2097152, PROT_NONE) = 0
mmap(0x2b0895fee000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 3, 0x2000) = 0x2b0895fee000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>
\0\1\0\0\0\300\342\1\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1375536, ...}) = 0
mmap(NULL, 3482232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x2b0895ff0000
mprotect(0x2b089613a000, 2093056, PROT_NONE) = 0
mmap(0x2b0896339000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_FIXED|MAP_DENYWRITE, 3, 0x149000) = 0x2b0896339000
mmap(0x2b089633e000, 17016, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b089633e000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b0896343000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b0896344000
arch_prctl(ARCH_SET_FS, 0x2b0896343af0) = 0
mprotect(0x2b0896339000, 12288, PROT_READ) = 0
munmap(0x2b08959af000, 20573) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK) = -1 ENXIO (No such device or
address)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffd5440e70) = -1 EINVAL
(Invalid argument)
brk(0) = 0x8e2e000
brk(0x8e2f000) = 0x8e2f000
brk(0x8e30000) = 0x8e30000
getuid() = 1005
getgid() = 1006
geteuid() = 1005
getegid() = 1006
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
brk(0x8e31000) = 0x8e31000
open("/proc/meminfo", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b08959af000
read(3, "MemTotal: 2097152 kB\nMemFree"..., 4096) = 771
close(3) = 0
munmap(0x2b08959af000, 4096) = 0
brk(0x8e32000) = 0x8e32000
rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL}, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_DFL}, 8) = 0
uname({sys="Linux", node="aine.fiee.net", ...}) = 0
stat("/var/www/xxx/_textemp", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getpid() = 14118
getppid() = 14117
brk(0x8e33000) = 0x8e33000
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"...}, 110) = 0
sendto(3, "\2\0\0\0\v\0\0\0\7\0\0\0passwd\0"..., 19, MSG_NOSIGNAL,
NULL, 0) = 19
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=3,
revents=POLLIN|POLLHUP}])
recvmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"passwd\0"..., 7}, {"\270O
\3\0\0\0\0\0"..., 8}], msg_controllen=24, {cmsg_len=20,
cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {4}}, msg_flags=0},
MSG_CMSG_CLOEXEC) = 15
mmap(NULL, 217016, PROT_READ, MAP_SHARED, 4, 0) = 0x2b08959af000
close(4) = 0
close(3) = 0
brk(0x8e34000) = 0x8e34000
getpgrp() = 29995
rt_sigaction(SIGCHLD, {0x439730, [], SA_RESTORER, 0x2b0896021f60},
{SIG_DFL}, 8) = 0
getrlimit(RLIMIT_NPROC, {rlim_cur=582*1024, rlim_max=582*1024}) = 0
brk(0x8e35000) = 0x8e35000
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/var/opt/context/tex/texmf-linux-64/bin/context", O_RDONLY) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffd5440ee0) = -1 ENOTTY
(Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR) = 0
read(3, "#!/bin/sh\nmtxrun --script context"..., 80) = 39
lseek(3, 0, SEEK_SET) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
dup2(3, 255) = 255
close(3) = 0
fcntl(255, F_SETFD, FD_CLOEXEC) = 0
fcntl(255, F_GETFL) = 0x8000 (flags O_RDONLY|
O_LARGEFILE)
fstat(255, {st_mode=S_IFREG|0755, st_size=39, ...}) = 0
lseek(255, 0, SEEK_CUR) = 0
brk(0x8e36000) = 0x8e36000
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
read(255, "#!/bin/sh\nmtxrun --script context"..., 39) = 39
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
brk(0x8e37000) = 0x8e37000
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/var/opt/context/tex/texmf-linux-64/bin/mtxrun",
{st_mode=S_IFREG|0755, st_size=428842, ...}) = 0
open("/proc/sys/kernel/ngroups_max", O_RDONLY) = 3
read(3, "65536\n"..., 31) = 6
close(3) = 0
brk(0x8eb7000) = 0x8eb7000
getgroups(65536, [1006]) = 1
stat("/var/opt/context/tex/texmf-linux-64/bin/mtxrun",
{st_mode=S_IFREG|0755, st_size=428842, ...}) = 0
brk(0x8eb8000) = 0x8eb8000
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
clone(Process 14119 attached (waiting for parent)
Process 14119 resumed (parent 14118 ready)
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x2b0896343b80) = 14119
[pid 14119] close(255
Am 2010-10-08 um 09:59 schrieb Florian Wobbe:
Thank you, but the problem is most probably something in my server setup that doesn't fit something in LuaTeX. As I mentioned: I got no problems calling TeX directly, just from the server process.
All right. I have one more suggestion. If you don't want to dive into debugging via gdb you should try another attempt at strace. Previously you posted a tracedump of context. But it only shows context (the shell script) waiting and nothing related to luatex. You may want to make strace follow forks (-f).
Sorry, I've no experience using strace.
Some things are explained here: http://blog.ksplice.com/tag/unix/
Here we are:
This is how my process tree looked: 14025 ? Sl 0:01 | \_ /var/www/xxx/bin/python /var/www/xxx/.../manage.py runfcgi ... 14116 ? S 0:00 | \_ /bin/sh -c set >> _context.log && strace -f context --batchmode --once hello >> _context.log 14117 ? S 0:00 | \_ strace -f context --batchmode --once hello 14118 ? T 0:00 | \_ /bin/sh /var/opt/context/tex/texmf-linux-64/bin/context --batchmode --once hello 14119 ? R 0:11 | \_ texlua /var/opt/context/tex/texmf-linux-64/bin/mtxrun --script context --batchmode --once hello
The logfile was empty, texlua seemed to hang. I killed 14119 and got: [...] [pid 14119] brk(0xaa3c000) = 0xaa3c000 [pid 14119] brk(0xaa5f000) = 0xaa5f000 [pid 14119] brk(0xaa82000) = 0xaa82000 [pid 14119] brk(0xaaa3000) = 0xaaa3000 [pid 14119] uname({sys="Linux", node="aine.fiee.net", ...}) = 0
This output looks quite messy because it is composed of the mixed output for five processes. I don't suspect the fault in luatex executable itself, however, mtxrun calls uname -m in a subshell and my guess is that it hangs there. Have you tried calling uname alone from your script? Next you could do strace -ff -o ctxtrace mtxrun --script context --batchmode --once hello This gives you hopefully four ctxtrace.<pid> files. Then do (for each pid) strace -p <pid> before killing luatex and see where it hangs. Interrupt and kill your luatex and have a look at the ctxtrace.* files. Florian
Am 2010-10-08 um 11:25 schrieb Florian Wobbe:
This output looks quite messy because it is composed of the mixed output for five processes. I don't suspect the fault in luatex executable itself, however, mtxrun calls uname -m in a subshell and my guess is that it hangs there. Have you tried calling uname alone from your script?
As I told Taco and Luigi off-list:
Simply calling uname works as well as calling it in a shell script as well as calling another Python script that calls uname.
Next you could do strace -ff -o ctxtrace mtxrun --script context --batchmode --once hello
Ok, here we are: 14203 ? Sl 0:01 | \_ /var/www/xxx/bin/python /var/ www/.../manage.py runfcgi method=threaded ... 14255 ? S 0:00 | \_ strace -ff -o ctxtrace mtxrun --script context --batchmode --once hello 14256 ? R 0:06 | \_ texlua /var/opt/context/ tex/texmf-linux-64/bin/mtxrun --script context --batchmode --once hello
This gives you hopefully four ctxtrace.<pid> files.
I got only one for 14256
Then do (for each pid) strace -p <pid> before killing luatex and see where it hangs. Interrupt and kill your luatex and have a look at the ctxtrace.* files.
strace -p 14256 attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted (as the same user as well as as root) After killing my log file is empty. The ctxtrace file says: execve("/var/opt/context/tex/texmf-linux-64/bin/mtxrun", ["mtxrun", "-- script", "context", "--batchmode", "--once", "hello"], [/* 10 vars */]) = 0 brk(0) = 0xe092000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b782d964000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b782d965000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=20573, ...}) = 0 mmap(NULL, 20573, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b782d967000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0> \0\1\0\0\0\300\342\1\0\0\0\0\0@"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1375536, ...}) = 0 mmap(NULL, 3482232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b782db65000 mprotect(0x2b782dcaf000, 2093056, PROT_NONE) = 0 mmap(0x2b782deae000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_FIXED|MAP_DENYWRITE, 3, 0x149000) = 0x2b782deae000 mmap(0x2b782deb3000, 17016, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b782deb3000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b782deb8000 arch_prctl(ARCH_SET_FS, 0x2b782deb86e0) = 0 mprotect(0x2b782deae000, 12288, PROT_READ) = 0 munmap(0x2b782d967000, 20573) = 0 brk(0) = 0xe092000 brk(0xe0b3000) = 0xe0b3000 execve("/var/opt/context/tex/texmf-linux-64/bin/texlua", ["texlua", "/ var/opt/context/tex/texmf-linux"..., "--script", "context", "-- batchmode", "--once", "hello"], [/* 10 vars */]) = 0 brk(0) = 0x1c0fd000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acfe2773000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acfe2774000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=20573, ...}) = 0 mmap(NULL, 20573, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2acfe2776000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libdl.so.2", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0> \0\1\0\0\0\20\16\0\0\0\0\0\0@"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0644, st_size=14616, ...}) = 0 mmap(NULL, 2109728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2acfe2974000 mprotect(0x2acfe2976000, 2097152, PROT_NONE) = 0 mmap(0x2acfe2b76000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED| MAP_DENYWRITE, 3, 0x2000) = 0x2acfe2b76000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libm.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P> \0\0\0\0\0\0@"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0644, st_size=534736, ...}) = 0 mmap(NULL, 2629848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2acfe2b78000 mprotect(0x2acfe2bfa000, 2093056, PROT_NONE) = 0 mmap(0x2acfe2df9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED| MAP_DENYWRITE, 3, 0x81000) = 0x2acfe2df9000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0> \0\1\0\0\0\300\342\1\0\0\0\0\0@"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1375536, ...}) = 0 mmap(NULL, 3482232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2acfe2dfb000 mprotect(0x2acfe2f45000, 2093056, PROT_NONE) = 0 mmap(0x2acfe3144000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_FIXED|MAP_DENYWRITE, 3, 0x149000) = 0x2acfe3144000 mmap(0x2acfe3149000, 17016, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2acfe3149000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acfe314e000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acfe314f000 arch_prctl(ARCH_SET_FS, 0x2acfe314eb10) = 0 mprotect(0x2acfe3144000, 12288, PROT_READ) = 0 mprotect(0xab0000, 8192, PROT_READ) = 0 munmap(0x2acfe2776000, 20573) = 0 brk(0) = 0x1c0fd000 brk(0x1c11e000) = 0x1c11e000 rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0 brk(0x1c13f000) = 0x1c13f000 brk(0x1c160000) = 0x1c160000 brk(0x1c181000) = 0x1c181000 brk(0x1c1a2000) = 0x1c1a2000 stat("/var/opt/context/tex/texmf-linux-64/bin/texlua", {st_mode=S_IFREG|0755, st_size=5371656, ...}) = 0 lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/opt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/opt/context", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/opt/context/tex", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/opt/context/tex/texmf-linux-64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 lstat("/var/opt/context/tex/texmf-linux-64/bin", {st_mode=S_IFDIR| 0755, st_size=4096, ...}) = 0 lstat("/var/opt/context/tex/texmf-linux-64/bin/texlua", {st_mode=S_IFLNK|0777, st_size=6, ...}) = 0 readlink("/var/opt/context/tex/texmf-linux-64/bin/texlua", "luatex"..., 2048) = 6 lstat("/var/opt/context/tex/texmf-linux-64/bin/luatex", {st_mode=S_IFREG|0755, st_size=5371656, ...}) = 0 stat("/var/opt/context/tex/texmf-linux-64/bin/mtxrun", {st_mode=S_IFREG|0755, st_size=428842, ...}) = 0 open("/var/opt/context/tex/texmf-linux-64/bin/mtxrun", O_RDONLY) = 3 close(3) = 0 open("/var/opt/context/tex/texmf-linux-64/bin/mtxrun", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0755, st_size=428842, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2acfe2776000 read(3, "#!/usr/bin/env texlua\n\nif not mod"..., 4096) = 4096 read(3, "tion nextchar(str, index)\n "..., 4096) = 4096 read(3, "erns.hexadecimal = P(\"0x\") * R("..., 4096) = 4096 brk(0x1c1c3000) = 0x1c1c3000 read(3, " return s\n else\n "..., 4096) = 4096 read(3, "kind = (kind == 2 and 3) or 1\n "..., 4096) = 4096 read(3, "t do -- no ipairs here\n if"..., 4096) = 4096 read(3, " do_serializ"..., 4096) = 4096 read(3, "at(st,\", \")))\n "..., 4096) = 4096 read(3, "otes,hexify)\n serialize(root,n"..., 4096) = 4096 read(3, "at(tt,seperator or \" \")\nend\n\nfunc"..., 4096) = 4096 read(3, "], f\n else\n return nil,"..., 4096) = 4096 brk(0x1c1e4000) = 0x1c1e4000 read(3, "ocal tabs = { }\nlocal concat = "..., 4096) = 4096 read(3, "parator, io.pathseparator, os.typ"..., 4096) = 4096 read(3, " clue what kind of OSX you're run"..., 4096) = 4096 read(3, "^.+[/\\\\](.-)$\") or name\nend\n\nloca"..., 4096) = 4096 read(3, "nd\n if n < 1 then\n "..., 4096) = 4096 read(3, " = \"Hans Hagen, PRAGMA-ADE, Ha"..., 4096) = 4096 brk(0x1c205000) = 0x1c205000 read(3, ")\",\"%1:\"))) or filename\nend\n\nfunc"..., 4096) = 4096 read(3, " = root .. path\n l"..., 4096) = 4096 read(3, " function dir.expandname(str) -- "..., 4096) = 4096 read(3, "lib.mkiv\",\n author = \"Hans "..., 4096) = 4096 read(3, "ult+1] = concat(tmp)\n "..., 4096) = 4096 read(3, "ies.report(\"merge: inserting %s\","..., 4096) = 4096 brk(0x1c22e000) = 0x1c22e000 read(3, "AGMA ADE / ConTeXt Development Te"..., 4096) = 4096 read(3, " t[#t+1] = key .. '"..., 4096) = 4096 read(3, " = P(\".\")\nlocal zero "..., 4096) = 4096 read(3, "nt in next, counters do\n i"..., 4096) = 4096 read(3, "hen\n local stoptime = "..., 4096) = 4096 read(3, "ompanion to luat-lib.mkiv\",\n a"..., 4096) = 4096 read(3, "default -- can be set from cnf fi"..., 4096) = 4096 read(3, "riments.enable(...)\n report(\"e"..., 4096) = 4096 brk(0x1c24f000) = 0x1c24f000 read(3, "eded but saves checking when we g"..., 4096) = 4096 read(3, "s.report(line)\n end\nend\n\nfunct"..., 4096) = 4096 read(3, " if not m then\n m = { }\n "..., 4096) = 4096 read(3, "g[ 0] = arg[2]\n for k=3,#arg d"..., 4096) = 4096 read(3, "\nend\n\nif arg then\n\n -- new, re"..., 4096) = 4096 read(3, "name)\n end\n els"..., 4096) = 4096 brk(0x1c270000) = 0x1c270000 read(3, "ot that down to less 7.3 seconds."..., 4096) = 4096 read(3, "file: \" .. gsub(txt,\"([ \\n\\r\\t]*)"..., 4096) = 4096 read(3, "resolved entity &%s; -> %s (inter"..., 4096) = 4096 read(3, "ttributevalue) / add_attribute\n--"..., 4096) = 4096 read(3, "tion)^0 * V(\"parent\") * trailer,\n"..., 4096) = 4096 read(3, "n='lpeg'/> from a filehandle so w"..., 4096) = 4096 read(3, "i=1,#edt do\n local"..., 4096) = 4096 read(3, " move to lxml-xml\n\nlocal result\n\n"..., 4096) = 4096 read(3, "nd v.special and v.tg == \"@pi@\" t"..., 4096) = 4096 read(3, "elative to current\n-- a|b|c : s"..., 4096) = 4096 brk(0x1c291000) = 0x1c291000 read(3, " p = ll.__p__\n local d = p"..., 4096) = 4096 read(3, " collect"..., 4096) = 4096 read(3, " Cc(\"')\")\nlocal lp_number = S(\"+"..., 4096) = 4096 read(3, "-child\" } -- , apply = "..., 4096) = 4096 read(3, "= (P(\"***/\") + P(\"/\")) * Cc(regi"..., 4096) = 4096 read(3, " if type(parsed) == \"string\" the"..., 4096) = 4096 read(3, " collected = apply_axis[pi.ax"..., 4096) = 4096 read(3, "== 0 then\n return -- somet"..., 4096) = 4096 brk(0x1c2b2000) = 0x1c2b2000 read(3, " false\n n = tonumber(n) or"..., 4096) = 4096 read(3, " local s = match(dkm,\"\\n(%s+"..., 4096) = 4096 read(3, " end\nend\n\nfunction xml.each(roo"..., 4096) = 4096 read(3, "cal d, k, rri = r.dt, e.ni, r.ri\n"..., 4096) = 4096 read(3, "]\n if type(str) ~="..., 4096) = 4096 read(3, "= xml.insertafter\nxml.insert_elem"..., 4096) = 4096 read(3, " local e = collection[c]\n "..., 4096) = 4096 read(3, " return next(t) and t or nil\nend\n"..., 4096) = 4096 brk(0x1c2d3000) = 0x1c2d3000 brk(0x1c2f4000) = 0x1c2f4000 read(3, " currentdir function\n "..., 4096) = 4096 read(3, "(\"resolvers.expansions\", function"..., 4096) = 4096 read(3, "turn newlist\nend\n\n-- We also put "..., 4096) = 4096 read(3, " dirs[#dirs+1] = p"..., 4096) = 4096 read(3, "ats['base'] "..., 4096) = 4096 read(3, " is somewhat dangerous, we want t"..., 4096) = 4096 read(3, "ache(\"created: %s\",cachepath)\n "..., 4096) = 4096 read(3, "itable,...)\n else\n "..., 4096) = 4096 read(3, "m-%d\"),\n time = os.date"..., 4096) = 4096 read(3, "ile.dirname, file.basename, file."..., 4096) = 4096 read(3, "alue and value ~= \"\" then\n "..., 4096) = 4096 read(3, " end\n "..., 4096) = 4096 read(3, " instance.files[tag] = { }\n"..., 4096) = 4096 read(3, " if vv ~= \"\" and not h[vv]"..., 4096) = 4096 brk(0x1c315000) = 0x1c315000 read(3, "e[ps] then\n ep"..., 4096) = 4096 read(3, " if not blobfile then\n "..., 4096) = 4096 read(3, " local forcedname, ok, suffix = \""..., 4096) = 4096 read(3, "rt_resolvers(\"forcing filetype '%"..., 4096) = 4096 read(3, "esolvers(\"match to '%s' in hash f"..., 4096) = 4096 read(3, " bname = files[rname]\n "..., 4096) = 4096 read(3, " local result = command(file"..., 4096) = 4096 read(3, "bsolete.find_file = resolvers.fi"..., 4096) = 4096 read(3, "limit\n\nif not modules then module"..., 4096) = 4096 read(3, " shared = data.unique, data.share"..., 4096) = 4096 brk(0x1c336000) = 0x1c336000 read(3, " end\n else\n"..., 4096) = 4096 read(3, " report_resolvers(\"zip fin"..., 4096) = 4096 read(3, "\n filter = format(\"^%s/(.+"..., 4096) = 4096 read(3, "solvers.finders, resolvers.opener"..., 4096) = 4096 read(3, "olvers(\"! locating '%s'\",name)\n "..., 4096) = 4096 read(3, "resolvers.cleanpath(oldname)\n "..., 4096) = 4096 read(3, "olvers = resolvers\n\nlocal functio"..., 4096) = 4096 read(3, " else\n re"..., 4096) = 4096 read(3, "os.platform == \"unix\" and \"\\\\\\\\\" "..., 4096) = 4096 read(3, " .. \"/../../../texmf-dist/tex/con"..., 4096) = 4096 brk(0x1c357000) = 0x1c357000 read(3, "tions = {\n [\"lua\"] = \"luatex -"..., 4096) = 4096 read(3, "ormat\n local path, nam"..., 4096) = 4096 read(3, "mpleline()\n logs.simpl"..., 4096) = 4096 read(3, "\n end\n end\nend\n\nfunctio"..., 4096) = 4096 read(3, "te but only if --autogenerate\n "..., 4096) = 4096 read(3, "his script\n-- ... later we will u"..., 4096) = 4096 read(3, "xecute\") then\n\n -- execute scr"..., 4096) = 4096 read(3, "guments_after)\n resolvers.dowi"..., 4096) = 2858 read(3, ""..., 4096) = 0 close(3) = 0 munmap(0x2acfe2776000, 4096) = 0 brk(0x1c37a000) = 0x1c37a000 brk(0x1c39d000) = 0x1c39d000 brk(0x1c3c0000) = 0x1c3c0000 brk(0x1c3e1000) = 0x1c3e1000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 --- SIGTERM (Terminated) @ 0 (0) --- +++ killed by SIGTERM +++ (I guess I could have shortened some lines, but didn't want to delete something important...) Greetlings, Hraban
On Oct 8, 2010, at 12:00 , Henning Hraban Ramm wrote:
Am 2010-10-08 um 11:25 schrieb Florian Wobbe:
This output looks quite messy because it is composed of the mixed output for five processes. I don't suspect the fault in luatex executable itself, however, mtxrun calls uname -m in a subshell and my guess is that it hangs there. Have you tried calling uname alone from your script?
As I told Taco and Luigi off-list:
Simply calling uname works as well as calling it in a shell script as well as calling another Python script that calls uname.
Next you could do strace -ff -o ctxtrace mtxrun --script context --batchmode --once hello
Ok, here we are: 14203 ? Sl 0:01 | \_ /var/www/xxx/bin/python /var/www/.../manage.py runfcgi method=threaded ... 14255 ? S 0:00 | \_ strace -ff -o ctxtrace mtxrun --script context --batchmode --once hello 14256 ? R 0:06 | \_ texlua /var/opt/context/tex/texmf-linux-64/bin/mtxrun --script context --batchmode --once hello
This gives you hopefully four ctxtrace.<pid> files.
I got only one for 14256
Right, so you are not even getting to the point where luatex is called. This is still texlua executing instructions from mtxrun.
Then do (for each pid) strace -p <pid> before killing luatex and see where it hangs. Interrupt and kill your luatex and have a look at the ctxtrace.* files.
strace -p 14256 attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted (as the same user as well as as root)
Something to do with SElinux?
[...] read(3, "his script\n-- ... later we will u"..., 4096) = 4096 read(3, "xecute\") then\n\n -- execute scr"..., 4096) = 4096 read(3, "guments_after)\n resolvers.dowi"..., 4096) = 2858 read(3, ""..., 4096) = 0 close(3) = 0 munmap(0x2acfe2776000, 4096) = 0 brk(0x1c37a000) = 0x1c37a000 brk(0x1c39d000) = 0x1c39d000 brk(0x1c3c0000) = 0x1c3c0000
Here, uname -m should be called. But I guess you still have all unames replaced by their return value I guess?
brk(0x1c3e1000) = 0x1c3e1000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 --- SIGTERM (Terminated) @ 0 (0) --- +++ killed by SIGTERM +++
Here it should continue with reading texmfcnf.lua. The last uname({sys="Linux", node="aine.fiee.net", ... you get is from the os.uname call I would guess. Try putting the lines for k, v in next, os.uname() do print(k, v) end in a file and run it with texlua from the script to be sure. Then you might also try to invoke luatex directly: luatex --interaction=batchmode --fmt="<path to>/formats/cont-en" --lua="<path to>/formats/cont-en.lui" --backend=pdf hello Florian
Am 2010-10-08 um 13:46 schrieb Florian Wobbe:
Right, so you are not even getting to the point where luatex is called. This is still texlua executing instructions from mtxrun.
strace -p 14256 attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted (as the same user as well as as root)
Something to do with SElinux?
As far as I can tell, SElinux isn't active. (libselinux is installed, but no other selinux package)
Here, uname -m should be called. But I guess you still have all unames replaced by their return value I guess?
Yes, I didn't reinstate the original mtxrun script.
brk(0x1c3e1000) = 0x1c3e1000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 --- SIGTERM (Terminated) @ 0 (0) --- +++ killed by SIGTERM +++
Here it should continue with reading texmfcnf.lua.
The last
uname({sys="Linux", node="aine.fiee.net", ...
you get is from the os.uname call I would guess.
Probably.
Try putting the lines
for k, v in next, os.uname() do print(k, v) end
in a file and run it with texlua from the script to be sure.
That works: texlua call_uname.lua version #1 SMP Tue Jul 6 14:34:09 MSD 2010 release 2.6.18-028stab070.2 machine x86_64 nodename aine.fiee.net sysname Linux
Then you might also try to invoke luatex directly:
luatex --interaction=batchmode --fmt="<path to>/formats/cont-en" -- lua="<path to>/formats/cont-en.lui" --backend=pdf hello
Now I get the defunct uname again: 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> (Meanwhile I switched from fcgi to gunicorn app server, but that didn't change anything WRT ConTeXt.) I get no log output. BTW: Thank you very much for your patience! I owe you! (And you, Taco, of course, and the others!) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Fri, Oct 8, 2010 at 3:47 PM, Henning Hraban Ramm
Am 2010-10-08 um 13:46 schrieb Florian Wobbe:
Right, so you are not even getting to the point where luatex is called. This is still texlua executing instructions from mtxrun.
strace -p 14256 attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted (as the same user as well as as root)
Something to do with SElinux?
As far as I can tell, SElinux isn't active. (libselinux is installed, but no other selinux package)
Here, uname -m should be called. But I guess you still have all unames replaced by their return value I guess?
Yes, I didn't reinstate the original mtxrun script.
brk(0x1c3e1000) Â Â Â Â Â Â Â Â Â Â Â Â = 0x1c3e1000 uname({sys="Linux", node="aine.fiee.net", ...}) = 0 --- SIGTERM (Terminated) @ 0 (0) --- +++ killed by SIGTERM +++
Here it should continue with reading texmfcnf.lua.
The last
 uname({sys="Linux", node="aine.fiee.net", ...
you get is from the os.uname call I would guess.
Probably.
Try putting the lines
for k, v in next, os.uname() do  print(k, v) end
in a file and run it with texlua from the script to be sure.
That works:
texlua call_uname.lua
version #1 SMP Tue Jul 6 14:34:09 MSD 2010 release 2.6.18-028stab070.2 machine x86_64 nodename     aine.fiee.net sysname Linux
Then you might also try to invoke luatex directly:
luatex --interaction=batchmode --fmt="<path to>/formats/cont-en" --lua="<path to>/formats/cont-en.lui" --backend=pdf hello
Now I get the defunct uname again:
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>
(Meanwhile I switched from fcgi to gunicorn app server, but that didn't change anything WRT ConTeXt.)
I get no log output. valgrind ?
-- luigi
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 and it is called like so: os.resultof('uname -m') 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()). Best wishes, Taco
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 version in the garden has: function os.resultof(command) ioflush() -- else messed up logging local handle = io.popen(command,"r") if not handle then -- print("unknown command '".. command .. "' in os.resultof") return "" else return handle:read("*all") or "" end end
and it is called like so:
os.resultof('uname -m')
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()).
I tried to redirect stdout and stderr to my log file, maybe that's a
problem then?
If I call using os.system, I can't redirect, but the result is the same.
I can redirect uname's output like so:
uname -m >> context.log
So I guess, it's using stdout at least normally - perhaps not via
os.resultof, no clue.
I just don't understand why any lua script would call uname externally
if it's available as os.uname?
Or does os.uname call os.resultof('uname')? (Probably not, otherwise
Florian's suggestion wouldn't have worked.)
print(os.resultof('uname -m'))
gives
attempt to call field 'resultof' (a nil value)
Can I import that function anyhow? I just copied it to my script and
replaced ioflush with io.flush.
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
execve("/var/opt/context/tex/texmf-linux-64/bin/texlua", ["texlua",
"call_uname.lua"], [/* 10 vars */]) = 0
brk(0) = 0x6a38000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb789f000
uname({sys="Linux", node="aine.fiee.net", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb78a0000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=20573, ...}) = 0
mmap(NULL, 20573, PROT_READ, MAP_PRIVATE, 4, 0) = 0x2b8eb78a2000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libdl.so.2", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>
\0\1\0\0\0\20\16\0\0\0\0\0\0@"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0644, st_size=14616, ...}) = 0
mmap(NULL, 2109728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4,
0) = 0x2b8eb7aa0000
mprotect(0x2b8eb7aa2000, 2097152, PROT_NONE) = 0
mmap(0x2b8eb7ca2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 4, 0x2000) = 0x2b8eb7ca2000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libm.so.6", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P>
\0\0\0\0\0\0@"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0644, st_size=534736, ...}) = 0
mmap(NULL, 2629848, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4,
0) = 0x2b8eb7ca4000
mprotect(0x2b8eb7d26000, 2093056, PROT_NONE) = 0
mmap(0x2b8eb7f25000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_DENYWRITE, 4, 0x81000) = 0x2b8eb7f25000
close(4) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>
\0\1\0\0\0\300\342\1\0\0\0\0\0@"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0755, st_size=1375536, ...}) = 0
mmap(NULL, 3482232, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4,
0) = 0x2b8eb7f27000
mprotect(0x2b8eb8071000, 2093056, PROT_NONE) = 0
mmap(0x2b8eb8270000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_FIXED|MAP_DENYWRITE, 4, 0x149000) = 0x2b8eb8270000
mmap(0x2b8eb8275000, 17016, PROT_READ|PROT_WRITE, MAP_PRIVATE|
MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b8eb8275000
close(4) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb827a000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb827b000
arch_prctl(ARCH_SET_FS, 0x2b8eb827ab10) = 0
mprotect(0x2b8eb8270000, 12288, PROT_READ) = 0
mprotect(0xab0000, 8192, PROT_READ) = 0
munmap(0x2b8eb78a2000, 20573) = 0
brk(0) = 0x6a38000
brk(0x6a59000) = 0x6a59000
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0
brk(0x6a7a000) = 0x6a7a000
brk(0x6a9b000) = 0x6a9b000
brk(0x6abc000) = 0x6abc000
brk(0x6add000) = 0x6add000
stat("/var/opt/context/tex/texmf-linux-64/bin/texlua",
{st_mode=S_IFREG|0755, st_size=5371656, ...}) = 0
lstat("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/opt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/opt/context", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/var/opt/context/tex", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
lstat("/var/opt/context/tex/texmf-linux-64", {st_mode=S_IFDIR|0755,
st_size=4096, ...}) = 0
lstat("/var/opt/context/tex/texmf-linux-64/bin", {st_mode=S_IFDIR|
0755, st_size=4096, ...}) = 0
lstat("/var/opt/context/tex/texmf-linux-64/bin/texlua",
{st_mode=S_IFLNK|0777, st_size=6, ...}) = 0
readlink("/var/opt/context/tex/texmf-linux-64/bin/texlua",
"luatex"..., 2048) = 6
lstat("/var/opt/context/tex/texmf-linux-64/bin/luatex",
{st_mode=S_IFREG|0755, st_size=5371656, ...}) = 0
stat("call_uname.lua", {st_mode=S_IFREG|0644, st_size=365, ...}) = 0
open("call_uname.lua", O_RDONLY) = 4
close(4) = 0
open("call_uname.lua", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=365, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb78a2000
read(4, "for k, v in next, os.uname() do\n "..., 4096) = 365
read(4, ""..., 4096) = 0
close(4) = 0
munmap(0x2b8eb78a2000, 4096) = 0
uname({sys="Linux", node="aine.fiee.net", ...}) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2b8eb78a2000
write(1, "version\t#1 SMP Tue Jul 6 14:34:09"..., 123version #1 SMP
Tue Jul 6 14:34:09 MSD 2010
release 2.6.18-028stab070.2
machine x86_64
nodename aine.fiee.net
sysname Linux
) = 123
pipe([4, 9]) = 0
clone(Process 30304 attached (waiting for parent)
Process 30304 resumed (parent 30303 ready)
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x2b8eb827aba0) = 30304
[pid 30304] close(4
Hi, On 10/08/2010 04:30 PM, Henning Hraban Ramm wrote:
I just don't understand why any lua script would call uname externally if it's available as os.uname?
My guess is that this is historical. Hans? Best wishes, Taco Sorry, no smart ideas about the rest of the problems any more
On 8-10-2010 4:57, Taco Hoekwater wrote:
Hi,
On 10/08/2010 04:30 PM, Henning Hraban Ramm wrote:
I just don't understand why any lua script would call uname externally if it's available as os.uname?
My guess is that this is historical. Hans?
yes, and also related to some issues on osx where the built in uname was not yet ok (needs checking, but not today by me) ----------------------------------------------------------------- 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 -----------------------------------------------------------------
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
Ok, the failures were the same with fcgi and gunicorn app servers. But it _works_ with django's dev server (which you must not use in production due to memory/security holes etc.). While ConTeXt runs it looks like: 5852 25767 TS 21 18:04 pts/0 00:00:00 \_ python manage.py runserver 8000 1477 5852 TS 23 18:07 pts/0 00:00:03 \_ /var/www/ cerebrale/bin/python manage.py runserver 8000 3395 1477 TS 22 18:08 pts/0 00:00:00 \_ /bin/sh -c date "+%Y-%m-%d %H:%M:%S" && cd /var/www/.../_textemp && /var/opt/ context/tex/texmf-linux-64/bin/context --purgeall --batchmode -- result="/var/www/... 3397 3395 TS 22 18:08 pts/0 00:00:00 \_ /bin/ sh /var/opt/context/tex/texmf-linux-64/bin/context --purgeall -- batchmode --result=/var/www/... 3398 3397 TS 15 18:08 pts/0 00:00:00 \_ texlua /var/opt/context/tex/texmf-linux-64/bin/mtxrun --script context --purgeall --batchmode --result=/var/www/... 3400 3398 TS 21 18:08 pts/0 00:00:00 \_ luatex --interaction=batchmode --fmt=/var/opt/context/tex/texmf- cache/.../cont-en --lua=/var/opt/context/tex... TeX completes fast, and everything seems well afterwards. But I started that app server from an active shell. Maybe that's the difference? Right, if I start gunicorn manually, it also works. So, the culprit seems to be the automatic background start of the app server via daemontools. I'll have to test other means of starting and supervising the processes - e.g. runit or supervisor. Since I like Python and don't want to replace "init" yet, I try the latter first. Some hours later: YES IT WORKS with supervisor so far! Thank you all for your patience, ideas and help! Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Am 2010-10-10 um 10:47 schrieb Patrick Gundlach:
Thank you all for your patience, ideas and help!
Sorry, that I didn't quite understand the problem/solution, could you describe in a few sentences what problem was and how you solved it?
I actually couldn't find out what the real problem was. ;-) I tried to start ConTeXt from a Django web application server. (Running ConTeXt from an active shell was no problem.) My Django FCGI processes were running under daemontools (http://cr.yp.to/daemontools.html ) supervision, i.e. started by its supervise daemon. In this setup, texlua hung at least at uname (and maybe other) calls. I found no error messages on that, I guess the environment was restricted in some way. Since I thought it might have to do with the FCGI server, I replaced that by Green Unicorn (http://gunicorn.org/), but that made no difference WRT ConTeXt. When I changed process supervision from daemontools to supervisor (http://supervisord.org/ ), I got no further problems. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Hi Henning, On 10/08/10 21:44, Henning Hraban Ramm wrote:
Ok, the failures were the same with fcgi and gunicorn app servers.
But it _works_ with django's dev server (which you must not use in production due to memory/security holes etc.).
We just had a somewhat similar problem (texlua hung at 100% cpu when run via apache) and it turns out, after lots of debugging, that mtxrun cannot do anything without $HOME. Perhaps yours was a different symptom of the same problem ? try this if you want to test CPU heat generation: $ env HOME= context knuth (use one process for each available cpu thread, of course) Best wishes, Taco
On 26-10-2010 9:28, Taco Hoekwater wrote:
Hi Henning,
On 10/08/10 21:44, Henning Hraban Ramm wrote:
Ok, the failures were the same with fcgi and gunicorn app servers.
But it _works_ with django's dev server (which you must not use in production due to memory/security holes etc.).
We just had a somewhat similar problem (texlua hung at 100% cpu when run via apache) and it turns out, after lots of debugging, that mtxrun cannot do anything without $HOME. Perhaps yours was a different symptom of the same problem ?
try this if you want to test CPU heat generation:
$ env HOME= context knuth
so what should HOME default to then? "."? ----------------------------------------------------------------- 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 -----------------------------------------------------------------
On 10/26/10 22:09, Hans Hagen wrote:
On 26-10-2010 9:28, Taco Hoekwater wrote:
Hi Henning,
On 10/08/10 21:44, Henning Hraban Ramm wrote:
Ok, the failures were the same with fcgi and gunicorn app servers.
But it _works_ with django's dev server (which you must not use in production due to memory/security holes etc.).
We just had a somewhat similar problem (texlua hung at 100% cpu when run via apache) and it turns out, after lots of debugging, that mtxrun cannot do anything without $HOME. Perhaps yours was a different symptom of the same problem ?
try this if you want to test CPU heat generation:
$ env HOME= context knuth
so what should HOME default to then? "."?
Not a default is what is needed, what is needed is that it should work without a HOME at all (server processes typically dont have one). Let's sort this out offlist. Best wishes, Taco
On 26-10-2010 10:56, Taco Hoekwater wrote:
On 10/26/10 22:09, Hans Hagen wrote:
On 26-10-2010 9:28, Taco Hoekwater wrote:
Hi Henning,
On 10/08/10 21:44, Henning Hraban Ramm wrote:
Ok, the failures were the same with fcgi and gunicorn app servers.
But it _works_ with django's dev server (which you must not use in production due to memory/security holes etc.).
We just had a somewhat similar problem (texlua hung at 100% cpu when run via apache) and it turns out, after lots of debugging, that mtxrun cannot do anything without $HOME. Perhaps yours was a different symptom of the same problem ?
try this if you want to test CPU heat generation:
$ env HOME= context knuth
so what should HOME default to then? "."?
Not a default is what is needed, what is needed is that it should work without a HOME at all (server processes typically dont have one).
sure, but I guess that some path specs have ~ and that we get a loop in the resolver due to this and for these patsh with ~ we need a proper default then
Let's sort this out offlist.
okay 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 -----------------------------------------------------------------
Am 2010-10-26 um 21:28 schrieb Taco Hoekwater:
We just had a somewhat similar problem (texlua hung at 100% cpu when run via apache) and it turns out, after lots of debugging, that mtxrun cannot do anything without $HOME. Perhaps yours was a different symptom of the same problem ?
Ah, I didn't check HOME; I'll add that to my environment, just in case. (But ATM it runs well.)
try this if you want to test CPU heat generation: $ env HOME= context knuth (use one process for each available cpu thread, of course)
;-) I'm using a rented virtual server and won't feel the heat. (And I guess the hoster will just throttle or disable it if I try to melt it.) Thank you! Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Just installed Ruby, fetched the latest beta and tried texexec: 26382 26367 TS 20 16:38 ? 00:00:01 \_ /var/www/xxx/bin/ python /var/www/xxx/manage.py run_gunicorn -c /var/www/.../gunicorn- settings.py 26509 26382 TS 20 16:38 ? 00:00:00 \_ /bin/sh -c texexec --batchmode --once hello >> _context.log 26510 26509 TS 20 16:38 ? 00:00:00 \_ /bin/sh /var/ opt/context/tex/texmf-linux-64/bin/texexec --batchmode --once hello 26511 26510 TS 14 16:38 ? 00:00:21 \_ texlua / var/opt/context/tex/texmf-linux-64/bin/mtxrun --usekpse --execute texexec --batchmode --once hello 26512 26511 TS 14 16:38 ? 00:00:00 \_ [uname] <defunct> Argl, I didn't knew texexec also depends on mtxrun/lua... Ok, patching mtxrun again, now I even replace os.uname, but I get the same as above. Hraban
Henning Hraban Ramm wrote:
I can imagine that it has something to do with SElinux settings, didn't dive in that yet.
That does sound familiar, in fact. I had a hanging database server a while back because I moved it to a different location. apparmor was the culprit in that case, so perhaps it is here as well ? (Basically an application will get a 'resource unavailable' when it tries to access anything outside of the apparmor allowed directories for that service/binary). In any case, check /etc/apparmor and /etc/apparmor.d Best wishes, Taco
Summary so far: * Machine: virtual server on Debian 5.0 (x86_64) (I thought it was Ubuntu, because I run that on my other Linux machines, sorry). * Webserver: Django 1.2/fcgi (Python 2.5) behind Nginx I can run ConTeXt without any problems from the shell, also as the same user that runs the server process. From the shell it doesn't matter if I call it as "context" (that's a shell script calling mtxrun), "mtxrun", other shell script or simple Python script. I want to run ConTeXt from the server process (at the end I want it to run via Celery/RabbitMQ, but that doesn't matter at the moment), but it hangs at the texlua process and doesn't do anything. - With an unmodified mtxrun that hangs at its external "uname" call (gets "defunct"); I patched it to just take "x86_64" instead of calling uname. - After that it doesn't matter how I call ConTeXt, it always hangs at texlua. - I tried os.system (that directly uses C's system call) and several variants of subprocess.Popen - I tried calling setuptex as well as setting PATH, TEXROOT and TEXMFOS for the environment of the process and checked that they exist in the call. - Calls of several linux tools via os.system or subprocess.Popen worked. I suspected SElinux settings, Taco hinted at AppArmor, but both aren't active, as far as I can tell. So, the problem is with the web server and texlua. Django/fcgi unfortunately swallows error messages (known problem of the fcgi mode). Next I'll try a different server setup. Unfortunately Apache with mod_wsgi or mod_python is too heavy for my virtual server (with Nginx I can run more that 5 Django sites, with Apache I had massive ressource problems with 3-4). Green Unicorn (http://gunicorn.org/) looks good for my purpose. Sorry for the OT thread, I suspected the problem being more in the LuaTeX area. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Sorry for the OT thread, I suspected the problem being more in the LuaTeX area.
I don't think it's in the LuaTeX area, for LuaTeX is just a regular process. I have to admit that I have run into similar problems with different software I tried to run from a "server process" (whatever this means) and it always took me some time to get it right. At the end it was aways clear to me why it wouldn't run (but I can't remember anymore, since it is many years ago). So I suggest to replace the LuaTeX call with different other software and see where it breaks. Use software that reads STDIN, that writes to STDOUT/STDERR and alike and see if they are ok. Patrick
Am 2010-10-08 um 10:12 schrieb Patrick Gundlach:
I don't think it's in the LuaTeX area, for LuaTeX is just a regular process.
Hm, I suspect it might be some system call inside LuaTeX that is blocked or the like.
I have to admit that I have run into similar problems with different software I tried to run from a "server process" (whatever this means) and it always took me some time to get it right. At the end it was aways clear to me why it wouldn't run (but I can't remember anymore, since it is many years ago). So I suggest to replace the LuaTeX call with different other software and see where it breaks. Use software that reads STDIN, that writes to STDOUT/STDERR and alike and see if they are ok.
A simple case like python -c "print 'Hello'" works ok. I tried shell commands and simple tools (echo, set, date, touch) before, and strace works, too. Even "texlua --help" works, so it's not texlua generally. texlua --script context --batchmode --once hello gives: "Script file context not found" (at least a usable error message, nothing hangs) The same with /var/opt/context/tex/setuptex && texlua --script context --batchmode -- once hello Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Fri, Oct 8, 2010 at 11:21 AM, Henning Hraban Ramm
Am 2010-10-08 um 10:12 schrieb Patrick Gundlach:
I don't think it's in the LuaTeX area, for LuaTeX is just a regular process.
Hm, I suspect it might be some system call inside LuaTeX that is blocked or the like.
I have to admit that I have run into similar problems with different software I tried to run from a "server process" (whatever this means) and it always took me some time to get it right. At the end it was aways clear to me why it wouldn't run (but I can't remember anymore, since it is many years ago). So I suggest to replace the LuaTeX call with different other software and see where it breaks. Use software that reads STDIN, that writes to STDOUT/STDERR and alike and see if they are ok.
A simple case like python -c "print 'Hello'" works ok. I tried shell commands and simple tools (echo, set, date, touch) before, and strace works, too.
Even "texlua --help" works, so it's not texlua generally.
texlua --script context --batchmode --once hello gives: "Script file context not found" (at least a usable error message, nothing hangs) The same with /var/opt/context/tex/setuptex && texlua --script context --batchmode --once hello I use something like this os.system("""bash -c 'cd /opt/luatex/minimals-new/tex ; source setuptex ; echo $PATH;cd "%(jobpath)s" && context --batch "%(filetex)s" 2>/dev/null 1>/dev/null'""" %kv)
-- luigi
On Fri, Oct 8, 2010 at 10:00 AM, Henning Hraban Ramm
Summary so far:
* Machine: virtual server on Debian 5.0 (x86_64) (I thought it was Ubuntu, because I run that on my other Linux machines, sorry). * Webserver: Django 1.2/fcgi (Python 2.5) behind Nginx
I can run ConTeXt without any problems from the shell, also as the same user that runs the server process. From the shell it doesn't matter if I call it as "context" (that's a shell script calling mtxrun), "mtxrun", other shell script or simple Python script.
I want to run ConTeXt from the server process (at the end I want it to run via Celery/RabbitMQ, but that doesn't matter at the moment), but it hangs at the texlua process and doesn't do anything. An user permissions/environment issue ? After this I have no other suggestions. -- luigi
Am 2010-10-08 um 10:37 schrieb luigi scarso:
An user permissions/environment issue ?
I can't exclude that, but since the web server and its subprocesses run as the same user that I (can) use for login and got no problems running TeX as that user, I wouldn't know where to look for the wrong permissions. Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Am 2010-10-08 um 10:37 schrieb luigi scarso:
An user permissions/environment issue ?
I can't exclude that, but since the web server and its subprocesses run as the same user that I (can) use for login and got no problems running TeX as that user, I wouldn't know where to look for the wrong permissions.
On Fri, Oct 8, 2010 at 10:47 AM, Henning Hraban Ramm
On 8-10-2010 10:00, Henning Hraban Ramm wrote:
Sorry for the OT thread, I suspected the problem being more in the LuaTeX area.
I never had problems running luatex (texlua) on linux boxes as part of a web service so I cannot image luatex being the problem. Can you see what pdftex does? 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 -----------------------------------------------------------------
participants (7)
-
Florian Wobbe
-
Hans Hagen
-
Henning Hraban Ramm
-
luigi scarso
-
Patrick Gundlach
-
taco
-
Taco Hoekwater