[GRASSLIST:158] RE: running grass commands from CGI script

Matt Doggett mdoggett at coas.oregonstate.edu
Fri May 23 17:37:28 EDT 2003


Upon further investigation, I discovered that if I redirect STDERR and
STDOUT when I call r.mapcalc, this problem goes away (e.g. `r.mapcalc
newgrid=A*B*C >somefile 2>&1`).

  Maybe someone can shed some light as to what r.mapcalc is doing to
STDOUT and/or STDERR that might be causing problems with apache?

matt

> -----Original Message-----
> From: owner-GRASSLIST at baylor.edu [mailto:owner-GRASSLIST at baylor.edu]
On
> Behalf Of Matt Doggett
> Sent: Friday, May 23, 2003 12:51 PM
> To: GRASSLIST at baylor.edu
> Subject: [GRASSLIST:155] running grass commands from CGI script
> 
> I am putting together a system using Mapserver to render maps online
> that are derived from GRASS raster grids. I am using CGI to POST to a
> cgi-bin executable which then invokes a series of GRASS commands to
> generate the raster before returning to Mapserver to display the
> results.  This process works GREAT except for the following:
> 
> 
> * r.mapcalc will "freeze" causing an apache timeout error.  To be
> precise, actually, invoking r.mapcalc a large (N) number of times will
> cause the server to timeout.  I'm not exactly sure what N is the
> critical threshold that causes problems (somewhere around 10 or so).
I
> have a simple process that calls r.mapcalc about five times and
doesn't
> cause any problems.  I have another complex function that can
> potentially call r.mapcalc dozens of times.  It is this complex
function
> that fails.
> 
> * This process fails ONLY when running through the CGI process and the
> apache webserver.  As a shell script from the command line...no
> problems, no errors.
> 
> * I can run any number of other grass commands (e.g. g.rename, g.copy,
> r.report, whatever). It seems to be only the r.mapcalc command that
> offends apache.
> 
> Has anyone done anything like this before and succeeded?  Obviously
the
> problem lies BOTH in Apache and r.mapcalc. Any suggestions?
> 
> Matt
> 
> Matt Doggett
> Spatial Climate Analysis Service
> Oregon State University
> 316 Strand Ag Hall
> Corvallis, OR 97331
> (541)737-9153
> mdoggett at coas.oregonstate.edu
> 




More information about the grass-user mailing list