[GRASS-dev] Unclean exit in 6.5: pgrep issue

Glynn Clements glynn at gclements.plus.com
Mon Nov 9 03:57:14 EST 2009


Hamish wrote:

> (it is not dumb simply trying to `killall wish`, afaiu Maris's tcl magic
> registers the PID of the gis.m session upon launch and attempts to cleanly
> shut that down on Init.sh exit)

Specifically, it uses wish to "send" a Gm::remoteExit command to each
"wish" it can find (via "winfo interps"). Gm::remoteExit takes the
session PID ($GIS_LOCK) as an argument, and only terminates if the
process belongs to that session.

There are many ways that this can fail to terminate a gis.m process
which should be terminated, but it's highly unlikely[1] to cause
problems for unrelated processes.

[1] Although theoretically possible. Because it only checks the PID,
and not the hostname, you could have two GRASS sessions on different
hosts but with the same PID, both running gis.m on the same X display. 
In this case, both gis.m processes would be terminated.

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


More information about the grass-dev mailing list