[Openmcl-devel] Faceless Background Server Behavior

Gary Byers gb at clozure.com
Wed Jan 8 11:46:14 PST 2003

When I do this (using tcsh), I see:

[src/ccl] gb at dervish> nohup openmcl -l tiny-server -e '(spawn-tiny-server)' &
[1] 10885

[src/ccl] gb at dervish>
[src/ccl] gb at dervish> Welcome to OpenMCL Version (Beta: Darwin) 0.14!
[1]  + Suspended (tty input)         openmcl -l tiny-server -e (spawn-tiny-server)
[src/ccl] gb at dervish>

I don't think that it should be reading from the tty unless/until #_select
tells it that it can do so without blocking (perhaps #_select is telling
it that there's a pending EOF or some other exceptional condition; I'm
not sure.)

0.13.2 shows about the same symptoms.

We don't really want 0.13.2's initial process to enter a read-eval-print
loop after spawing the tiny server (or 0.14's initial process to spawn
a read-eval-print-loop after spawing the tiny server.)  We could
probably do SAVE-APPLICATION with the right sort of :TOPLEVEL-FUNCTION
argument so that that read-eval-print loop is never entered; another
approach (that's not -quite- right, but is a lot closer) is to keep
the process that executes command-line-args from ever getting around
to creating/entering a read-eval-print loop.

[src/ccl] gb at dervish> nohup openmcl -l tiny-server -e '(spawn-tiny-server)' -e '(loop (sleep 5))' &
[1] 10898
[src/ccl] gb at dervish> telnet localhost 1701
Trying ::1...
telnet: connect to address ::1: Connection refused
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

[src/ccl] gb at dervish> ps
  418  p1  S+     0:00.57 -tcsh (tcsh)
10803 std  Ss     0:00.15 -csh (tcsh)
10898 std  R      0:05.79 /usr/local/src/ccl-0.13/ccl/dppccl -l tiny-server -e

I think that there's probably a bug if the listener process is actually
trying to read from a (detached) tty; I'll try to look into that.

I think that what we'd want here is an easier way to say "don't create/enter
a read-eval-print loop", since the best we could hope for if a r-e-p-l was
entered is to see a prompt and have it wait infinitely.

A faceless background process should probably also either allow itself to be
terminated by SIGINT or ignore it completely.  (Entering a break loop is
probably pretty low on the list of things it should do, and I have a hunch

[gb at dervish] kill -INT 10898

would be fun to watch, at least the first time.)

Perhaps invoking 'openmcl --server ...' should do some/all of these things
for you ?

[Note that 'nohup' is a shell builtin in tcsh; the behavior I saw may be
a little different from what you saw if you used a different shell.]

Openmcl-devel mailing list
Openmcl-devel at clozure.com

More information about the Openmcl-devel mailing list