[GRASS-user] Can't create location

Glynn Clements glynn at gclements.plus.com
Thu Jul 6 16:53:06 EDT 2006


Markus Neteler wrote:

> On Thu, Jul 06, 2006 at 04:14:40AM +0100, Glynn Clements wrote:
> > Markus Neteler wrote:
> ...
> > > In my PHP earthquake script must be a bug since
> > > /tmp/grass6-apache-$$/
> > > is generated...
> > 
> > Init.sh initialises GIS_LOCK from $$, which is the PID of the shell
> > process running the script. That should work in any Bourne shell; it
> > won't work in other languages, e.g. PHP. Presumably the PHP script is
> > initialising the environment itself, and not using Init.sh?
> 
> That's correct. I would better use a PHP session somehow.
> 
> Page:
>  http://grass.itc.it/spearfish/php_grass_earthquakes.php
> Code:
>  http://grass.itc.it/spearfish/php_grass_earthquakes.txt

The PID is available in PHP via posix_getpid(); however, if you are
using mod_php (rather than spawning the PHP interpreter as a separate
process), that may not be sufficiently unique.

It used to be the case that $GIS_LOCK actually needed to be a PID, for
creating lock files. AFAICT, that's only applicable to using FIFOs for
the display drivers, or using digitising tablets in the 5.x version of
v.digit. IOW, it doesn't matter any more.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list