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

GRASS GIS trac at osgeo.org
Mon Jan 28 09:06:31 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
 Keywords:           |        CPU:  Unspecified
 Platform:  Linux    |
---------------------+-------------------------
 After closing the GRASS GUI the user account's local env is not being
 restored. E.g.

 {{{
 $ echo $PATH
 /home/pmav99/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/xpra:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

 $ which python
 /usr/bin/python

 $ cat src2/grass/run_gui.sh
 #!/usr/bin/env bash
 #
 # Run the GRASS GUI, after activating the virtualenv

 # the 'dirname readlink' line finds the directory where this script is
 located.
 # https://stackoverflow.com/questions/59895/getting-the-source-directory-
 of-a-bash-script-from-within
 GRASS_SRC="$(dirname $(readlink -f $0))"

 source "${GRASS_SRC}"/venv/bin/activate
 exec "${GRASS_SRC}"/bin.x86_64-pc-linux-gnu/grass77

 $ src2/grass/run_gui.sh
 Starting GRASS GIS...
 Cleaning up temporary files...

 Welcome to GRASS GIS 7.7.svn (r74037)
 ...
 [closing the gui]
 ...

 $ echo $PATH
 /home/pmav99/.local/bin:/home/pmav99/src2/grass/dist.x86_64-pc-linux-
 gnu/bin:/home/pmav99/src2/grass/dist.x86_64-pc-linux-
 gnu/scripts:/home/pmav99/.grass7/addons/bin:/home/pmav99/.grass7/addons/scripts:/home/pmav99/src2/grass/venv/bin:/home/pmav99/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/xpra:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

 $ which python
 /home/pmav99/src2/grass/venv/bin/python
 }}}

 As you can see $PATH has changed. Is this by design? Shouldn't the
 original session be completely restored?

 PS. Sorry if this has been mentioned before, but I couldn't find anything
 relevant.

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



More information about the grass-dev mailing list