Author Topic: headless server generates infinite output if stdin hangs up  (Read 697 times)

ctz

  • Summoner
  • **
  • Posts: 46
  • aka cathaur, formerly lyra
    • View Profile
When the "vps" option is not used, headless server generates repetitive output if nothing is connected to the write end of stdin.
Try this in the shell:
Code: [Select]
$ megaglest --headless-server-mode > file &
$ ^D
This leaves megaglest alive in the background until it is killed.
file will be full of
Code: [Select]
server command []
error in file descriptor
hang up in file descriptor
server command []
error in file descriptor
hang up in file descriptor

Or try this:
Code: [Select]
$ cat | megaglest --headless-server-mode
^D
to get a lot of
Code: [Select]
server command []
hang up in file descriptor
server command []
hang up in file descriptor

The process should not try to re-open stdin after it fails to do so, since it is likely that the write end of stdin will never be open again.  The only exception I can think of is if stdin is a fifo, but I believe mkfifo fifo; megaglest --headless-server-mode < fifo & echo > fifo ... and later, echo "quit" > fifo is an unlikely way to run it.

(edit: fix typo in first command)
« Last Edit: 5 January 2014, 08:26:04 by ctz »

 

anything