[GRASS-dev] How GRASS should behave when another session is already active?

Vaclav Petras wenzeslaus at gmail.com
Mon Jun 1 18:05:24 PDT 2015


Hi all,

I need opinions on how to resolve the question whether GRASS session can be
started from another GRASS session.

Here we want to use GISBASE from environment instead of build constant if
available:

https://trac.osgeo.org/grass/changeset/45576

However, here we cause error when GISBASE already exists:

http://trac.osgeo.org/grass/changeset/59210

But the check was removed in:

http://trac.osgeo.org/grass/changeset/59220

because of:

http://trac.osgeo.org/grass/ticket/2213

The point of r59210 was to make impossible to start another GRASS session
within an existing session. However, r45576 is using exactly same check
(GISBASE in env) to see if GISBASE is forced from outside. The two places
for it are here:

https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L48
https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?annotate=blame&rev=65348#L1633

I think starting non-interactive session (batch/exec mode) should be
possible. Perhaps interactive session (--text & --gui) should have the
check.

If the check is present (even just for the interactive sessions), the
OSGeo4W version (and probably standalone winGRASS too) is going to break
(needs to be changed somehow). Moreover, this would disallow setting some
GISBASE to system for scripting purposes ("without starting explictly") and
then starting a standard session.

The issue with the current state is that you cannot run different version
of GRASS from a current session. More serious issue is that you cannot
start another version if you have GISBASE in your system environment for
scripting purposes (as mentioned above). The current behavior may also
differ depending on a platform.

I'm not really sure what were the original intentions but I would prefer to
switch the logic in r45576 and use GISBASE only if the path from compile
time does not exist. This allows to override current session (GISBASE set
in some way) but allows to supply the GISBASE when there is something wrong
with compile time path. I would use some advice because I don't know how
this works on Windows and Mac nor what grass.sh file is supposed to do.

Thanks,
Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150601/7778fe5e/attachment.html>


More information about the grass-dev mailing list