Subject: | Multiuser problem |
Date: | Tue, 11 Sep 2007 15:56:58 -0700 |
To: | bug-forks-BerkeleyDB [...] rt.cpan.org |
From: | "Piotr Jackowski" <jackowski.piotr [...] gmail.com> |
Hi,
At the begging I would like to thank you for that superb modules forks and
forks::BerkeleyDB. They are very useful for me. I'm using them in productive
environment.
But on my development environment many users use that module, and there
is a problem with privileges.
forks:: BerkeleyDB saves by default in /tmp/pelrforks/ENV_SUBPATH
subdirectory shared variables.
ENV_SUBPATH is defined in forks::BerkeleyDB::Config.pm with:
use constant ENV_SUBPATH => int(ENV_PID / 100).'/'.ENV_PID.'/bdb';
where ENV_PID => $$
When one user will use forks::BerkeleyDB with for example with $$ == 30001
then module will create /tmp/perlforks/300/30001 directory
But when another user with $$ == 30002, module will try to crate
/tmp/perlforks/300/30002 that will crash with unable to create
30002 subdirectory and program dies:(
So workerund for this is for example
use constant ENV_SUBPATH => int(ENV_PID * 100).'/'.ENV_PID.'/bdb';
Regards,
Peter