[plt-scheme] Interactions of the REPL and the shell

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Mon Jun 5 12:23:51 EDT 2006

I have a problem with the interaction between the REPL,
MzScheme flags, and the shell.

I have a program (instaweb) that runs the web server and
then reads a user command to restart or stop the server. 
This is useful for development.  It is useful to use this
same, tested, program to run the web server on the live
server.  In this case we obviously don't want an
interactive shell, as logging out would kill the web
server.  So if the command to run the program is

  mzscheme -qf run-server.ss

we could instead run it as 

  nohup mzscheme -qf run-server.ss &

This is fine, except MzScheme now has no stdin.  The call
to read in instaweb causes an error.  This error is caught
by the repl, which prints an error message and loops.  In a
few days it is possible to fill a 70GB disk with a log file
containing just this error message.

There are various hacks to fix this, and I've implemented
one (in this case, a flag to instaweb determining if it
reads).  I'm interested in the best way to solve this
problem.  Ideally I don't want to have to remember special
flags or bash commands to start the program to get it to
work.  Instaweb would see that there is no stdin and so
realise the interactive terminal isn't useful.  However the
repl never returns the exception that indicates this.  I
could change the error escape handler.  This is unorthodox
(at least I haven't seen any examples of this before).  As
it is I'm a bit lost between all the switches MzScheme
takes, and the various interactions of the REPL.  Guidance


Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
AIM: noelhwelsh
Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/untyping/

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Posted on the users mailing list.