[GRASS-dev] [GRASS GIS] #3740: The GRASS session is "leaking" to the environment

GRASS GIS trac at osgeo.org
Mon Jan 28 14:28:14 PST 2019


#3740: The GRASS session is "leaking" to the environment
--------------------------+-------------------------
  Reporter:  pmav99       |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:
 Component:  Startup      |    Version:  svn-trunk
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  Linux
--------------------------+-------------------------

Comment (by pmav99):

 The relevant code seems to be this (_1):

 {{{
 2599        def _quitGRASS(self):
 2600            """Quit GRASS terminal"""
 2601            try:
 2602                shellPid = int(grass.gisenv()['PID'])
 2603            except:
 2604                grass.warning(_("Unable to exit GRASS shell: unknown
 PID"))
 2605                return
 2606
 2607            Debug.msg(1, "Exiting shell with
 pid={0}".format(shellPid))
 2608            import signal
 2609            os.kill(shellPid, signal.SIGTERM)
 }}}

 The logic of the code that calls `_quitGRASS` seems AFAI can tell correct.
 I don't see the warning on the console, so assuming that warnings do get
 logged by default, the problem could be in the `os.kill` call. To be
 honest, the main reason I was using `exec` in the first place was to have
 proper signal propagation (_2). Could someone tell me how can I increase
 the log level?

 _1:
 https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/lmgr/frame.py#L2599

 _2: https://unix.stackexchange.com/a/196053/37579

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3740#comment:5>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list