Forum archive 2000-2006

John Jones - A latex daemon and signals

John Jones - A latex daemon and signals

by Arnold Pizer -
Number of replies: 0
inactiveTopicA latex daemon and signals topic started 2/13/2004; 10:40:33 AM
last post 2/13/2004; 11:59:59 PM
userJohn Jones - A latex daemon and signals  blueArrow
2/13/2004; 10:40:33 AM (reads: 1013, responses: 3)
Hi,

I have been experimenting with a latex daemon found on the
web.  It works when I call it in a shell, but not when WW calls
it.  I have tracked the problem pretty far and am hoping the
experts will be able to help.

The basics of how it works are:
  • the idea is that latex is constantly running, and we feed it snippets to typeset.  Once it is up, you invoke a new program (really shell script) called ilatex on the bit to be typeset.
  • there is a fifo used for the latex file and the dvi file
  • when ilatex is called on a snippet, it gets a special command added to the beginning saying what process number sent it.  There are also bits saying "snippet starts here" and "snippet ends here".  Then  ilatex has to  wait  for the  daemon to do its work.
  • another program reads the output dvi file.  It basically converts the snippets into complete dvi files.  When it sees that a snippet is complete, it sends a signal to the process number of ilatex which sent it to begin with.  That is how the ilatex knows that its dvi file is ready since the latex process itself never ends.
With that background, I think I can describe the problem.  When WW calls ilatex, the snippet does get run through the latex daemon, and the program which reads the dvi fifo does its job of creating a usable dvi file and sending its signal (SIGUSR1).  But, ilatex never hears that signal.  All of this happens in a single system call from WW.

Does WW do something to catch all signals of programs it calls?

John

<| Post or View Comments |>


userJohn Jones - Re: A latex daemon and signals  blueArrow
2/13/2004; 2:38:00 PM (reads: 1226, responses: 0)
OK, here is a partial answer to my own question, followed by another.

Safe blocks/eats signals between system calls made inside it and programs started outside of it.  From a simple test, it clearly stopped a SIGUSR1 signal.  Maybe other signals are not stopped.

Now the question is whether there is a reasonable way around that.

John

<| Post or View Comments |>


userJohn Jones - Re: A latex daemon and signals  blueArrow
2/13/2004; 5:48:58 PM (reads: 1263, responses: 0)
As an addendum to my last message, in what sort of environment is render from the new ImageGenerator (pg/WeBWorK/PG/ImageGenerator.pm) run?  Is it in a safe compartment?

John

<| Post or View Comments |>


userSam Hathaway - Re: A latex daemon and signals  blueArrow
2/13/2004; 11:59:59 PM (reads: 1253, responses: 0)
Hi John,

In WeBWorK 2, render is called from outside of the safe compartment by the caller of the translator. Take a look in webwork-modperl/lib/WeBWorK/PG/Local.pm.

<| Post or View Comments |>