[GRASS-dev] [GRASS GIS] #2213: Windows startup broken

#2213: Windows startup broken
-------------------------+--------------------------------------------------
Reporter: jbrauner | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Hi GRASS developers,

I downloaded and installed the weekly snapshot today (built on the
revision 59215) and was provided with the following error message during
startup:

"ERROR: GRASS GIS seems to be already running. Exiting."

I digged a little bit and found that since the very recent 59210 revision,
the following statement:

if 'GISBASE' in os.environ:
     sys.exit(_("ERROR: GRASS GIS seems to be already running. Exiting."))

(see
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?rev=59210#L1227)

breaks the successful start under Windows (both winGRASS weekly build and
osgeo4w).

Possible reason:

For the winGRASS install, the GISBASE env variable is set by the
grass70svn.bat (which I think is created here:
http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/GRASS-
Installer.nsi.tmpl) which sets this variable for Windows before calling
the Python startup script. Thus, startup always has to fail. Commenting
the if clause out in the Python script did the trick for a successful
start (I believe the if clause was introduced for a reason though ;-)).

For the osgeo4w install, the GISBASE env variable is set by the env.bat
(which I think is created here:
http://trac.osgeo.org/grass/browser/grass/trunk/mswindows/osgeo4w/env.bat.tmpl)
which sets this variable for Windows before calling the Python startup
script. Thus, startup always has to fail. Commenting the if clause out in
the Python script did the trick for a successful start (I believe the if
clause was introduced for a reason though ;-)).

Please let me know if I can help any further.

Cheers and keep up the good work,

Johannes

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213&gt;
GRASS GIS <http://grass.osgeo.org>

#2213: Windows startup broken
-------------------------+--------------------------------------------------
Reporter: jbrauner | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by jbrauner):

* cc: jbrauner (added)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2213: Windows startup broken
-------------------------+--------------------------------------------------
Reporter: jbrauner | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [ticket:2213 jbrauner]:

> "ERROR: GRASS GIS seems to be already running. Exiting."
>
> I digged a little bit and found that since the very recent 59210
revision, the following statement:
>
> if 'GISBASE' in os.environ:
> sys.exit(_("ERROR: GRASS GIS seems to be already running.
Exiting."))
>
> (see
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py?rev=59210#L1227)

you are right, I commented-out this part in r59220. The next winGRASS
build should be fixed, sorry for inconvenience.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2213: Windows startup broken
-------------------------+--------------------------------------------------
Reporter: jbrauner | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by martinl):

Replying to [ticket:2213 jbrauner]:

> clause out in the Python script did the trick for a successful > start
(I believe the if clause was introduced for a reason though ;-)).

the reason was to avoid starting GRASS from already running session

$ grass70
> grass70

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2213: Windows startup broken
--------------------------+-------------------------------------------------
  Reporter: jbrauner | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2213: Windows startup broken
--------------------------+-------------------------------------------------
  Reporter: jbrauner | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.0
Component: Startup | Version: svn-trunk
Resolution: fixed | Keywords:
  Platform: MSWindows 7 | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by jbrauner):

Wow, unbelievable. That was more than instant in the middle of the night
(at least for me it's past midnight). Thanks a lot, Martin.

I'm thinking about how to avoid starting GRASS from an already running
session for Windows (need some sleep before). You're probably quicker with
a solution but if I come up with an idea, I'll let you know (not much of a
Python guy myself though).

Certainly no inconvenience caused.

Johannes

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2213#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>