[GRASS5] Files left in /tmp from Init.sh

Hamish hamish_nospam at yahoo.com
Tue Feb 8 23:58:04 EST 2005


> The previous proposal of solution to remove files left in /tmp
> directory (when  GRASS 6.0 or 5.7 is left without command "exit") is
> not a good idea. To trap  the signal SIGHUP in particular introduce
> more problems than it solve. There is a simplier and better (I think)
> solution which is:
> 
> in etc/Init.sh v 1.58 2005/02/03 02:24:42 hamish
> 
> As soon as temporary directory is created:
> row 107
> +  trap "rm -rf $tmp" 0
> 
> row 542
> -  rm -rf "$tmp"  # remove session files from tmpdir
> 
> After LOCATION and MAPSET are saved in $GISRC
> row 549
> +  trap "cp $GISRC $GISRCRC ; rm -rf $tmp" 0
> 
> row 715
> -  trap 2 3 15
> + trap 0 2 3 15
> 
> I wait for your suggestions



A couple more cases where files get left behind in /tmp:

- exiting GRASS from both Startup Tcl GUI (Exit) and text UI (^C)
- auto-exit of GRASS after "Create Location From EPSG"



Hamish




More information about the grass-dev mailing list