Opened 14 years ago
Closed 14 years ago
#1074 closed defect (fixed)
$GRASS_BATCH_JOB isn't executed
Reported by: | martin | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.0 |
Component: | Startup | Version: | svn-trunk |
Keywords: | startup | Cc: | |
CPU: | x86-64 | Platform: | Linux |
Description
GRASS SVN trunk is installed into /opt/GRASS70/ (analogously to the one in #491). I've copied a rudimentary $GISDBASE and ~/.grass7/rc from another machine which is capable of running a GUI. GRASS_GUI is set to text in the rc file.
hypersphere: 10:15:36 ~> pwd /home/martin hypersphere: 10:15:37 ~> ls -l landcover/grassimport_pg.sh -rwxr-xr-x 1 martin users 6590 19. Mai 09:51 landcover/grassimport_pg.sh hypersphere: 10:15:40 ~> head -1 landcover/grassimport_pg.sh v.in.ogr dsn="PG:host=zuluviz.optiputer.net dbname=landcover user=webuser" layer=cstest_agroforest output=cstest_agroforest
Ok, now:
hypersphere: 10:15:44 ~> env LOCATION=/home/martin/grassdata/world/PERMANENT GRASS_BATCH_JOB=/home/martin/landcover/grassimport_pg.sh /opt/GRASS70/bin/grass70 Cleaning up temporary files... Starting GRASS GIS... Executing '/home/martin/landcover/grassimport_pg.sh' ... Welcome to GRASS 7.0.svn (2010) [... nothing happens ...] hypersphere /home/martin> exit exit Cleaning up temporary files... Batch job '/home/martin/landcover/grassimport_pg.sh' (defined in GRASS_BATCH_JOB variable) was executed. Goodbye from GRASS GIS
Actually almost everything is fine - just the $GRASS_BATCH_JOB script doesn't get executed as promised. When copying script lines into the GRASS command prompt, they're being processed nicely. Same batch setup worked perfectly with GRASS64 and I didn't encounter any differences in the HTML manual pages, therefore I decided to file a bug.
Cheers, Martin.
Attachments (2)
Change History (11)
comment:1 by , 14 years ago
Component: | default → Python |
---|
comment:2 by , 14 years ago
Keywords: | startup added |
---|
One thing I've wanted to see for a long time, and grass7 init.py is a great opportunity for, is to have better parsing of command line options than grass 6's init.sh has. Maybe I'm just used to how good G_parser() is by comparison..
Anyway, it would be great to be able to pass the batch job script filename as a command line option to init.py instead of having to mess with special environment variable hacks etc. to get it to work.
thanks, Hamish
ps- any objections/comments to adding a "startup" component in trac?
comment:3 by , 14 years ago
Component: | Python → Startup |
---|
follow-up: 7 comment:6 by , 14 years ago
Hi,
using the patch below, the file specified in GRASS_BATCH_JOB variable is executed as expected.
Alessandro Frigeri
follow-up: 8 comment:7 by , 14 years ago
comment:8 by , 14 years ago
Replying to martinl:
Replying to alf:
using the patch below, the file specified in GRASS_BATCH_JOB variable is executed as expected.
thanks, slightly modified patch applied in r42535. Martin
Good!
find another patch with the Popen wait method, that waits for the batch job to be finished before going on.
Alessandro
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch tested, seems to work fine now. applied in r42536. thanks.
The code in
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L608
seems to be a stub:
rather than a launch of the script.