[GRASS5] nviz problem

Glynn Clements glynn at gclements.plus.com
Thu Dec 30 05:31:24 EST 2004


[I'm currently recovering from a hard drive failure, and have only
just started catching up on the email backlog.]

Bob Covill wrote:

> The script is mean't as a temporary fix so that you can run nviz with
> options in the background (&). Try "./i -q &" and nviz should start up
> in quick mode running in the background.
> 
> Nviz uses both G_parser and wish style arguments. In other words nviz is
>    a customized version of wish that accepts GRASS style commands. The
> trick is to make sure that the GRASS commands are not stripped out by
> the TK wish portion. The "-f" flag tells it to execute the script
> (nviz2.2_script in our case) in the same way that wish would execute a
> script. Remember that the current nviz executable is simply the old
> NVWISH renamed.
> 
> The problem seems to be related to the fact that nviz2.2_script is
> currently executed internally with Tcl_Eval. If nviz is executed in the
> background the whole thing hangs up. The trick is to figure out how to
> call this correctly?

When run without the -f switch, "wish" behaves like a shell, i.e. it
reads from stdin. If wish is run via a shell running on a terminal,
stdin will normally refer to the process' controlling terminal.

If a process which isn't a member of the foreground process group
(i.e. one which is running in the background) attempts to read from
the controlling terminal, it will receive SIGTTIN; the default
behaviour of that signal is to suspend the process (similar to SIGSTOP
and SIGTSTP).

NVIZ shouldn't behave like a shell so, if it is implemented as a
typical "enhanced wish", it must always be run with the "-f" switch.

IMHO, eliminating the nviz script and renaming the NVWISH2.2
executable to "nviz" was a mistake. I presume that this was done in
response to the G_gui() issues, but I think that it's the wrong
approach.

It would probably have been better to force G_gui() to call "nviz"
rather than using the name of the current executable, either by
manipulating argv[] or by adding a function to parser.c to allow a
module to specify its name.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list