I got mod_dav to serve files from NFS without problems by doing something I
shouldn't:

-
apr-util-1.2.12/dbm/sdbm/sdbm_private.h
46,47c46,47
< #define SDBM_SHARED_LOCK      0x4    /* data base locked for shared read */
< #define SDBM_EXCLUSIVE_LOCK   0x8    /* data base locked for write */
---
> #define SDBM_SHARED_LOCK      0x2    /* data base locked for shared read */
> #define SDBM_EXCLUSIVE_LOCK   0x2    /* data base locked for write */
-

The hex 0x1 is SDBM_RDONLY
The hex 0x2 is SDBM_SHARED

With the above change, I disabled SHARED_LOCK and EXCLUSIVE_LOCK for SDBM files
in apr-util, setting them instead to SDBM_SHARED.


I shouldn't do this, but apparently apr wants to use flock which is not usable
on NFS. I tried to recompile apr without flock, and only fcntl but mod_dav
complains with this change.

So, I would assume this is as close as possible I can make SDBM work as
GDBM->GDBM_NOLOCK.

With this change, the LockDB is still updated when a LOCK is performed, and the
associated property database for files served in DAV are also updated.

I am guessing this will be a problem if two threads attempt to access these
databases at the same time, however I am not overly concerned about providing
file locking capabilities right now, nor providing the storage of extra file
properties.


I would think that support for serving files through mod_dav from NFS should be
a basic supported feature.

With Apache 2.2, the file locking is performed exclusively in apr-util (defined
in apr), and Apache level modules have little say in the use of file locking.

Also, the dbm format is also exclusively defined in apr-util, and the
./configure --with-db=<dbm> does not work as of 1.2.12. And it would appear that
only SDBM is really supported anyway, and also mod_dav expects SDBM and
apparently only works with SDBM.


Also, I have noticed some linux distibutions actually mention in the notes that
GDBM support is broken in Apache 2.


Feature request: :-)
 - It would be great if GDBM 1.8 was supported in Apache 2
 - And a way to specify no locking be used for property databases, i.e. simply
indicating in httpd.conf that GDBM_NOLOCK flag should be used.
Example: httpd.conf
-
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    DavLockDB /var/lib/dav/lockdb
    DavLockDBSysLock on
    DavPropDBSysLock off
-

Then if we wish to serve files from NFS via mod_dav, we can simple specify
DavPropDBSysLock as "off" to use the GDBM_NOLOCK flag
And if apr-util is not compiled with GDBM support, it would ignore it and
perhaps supply a warning like "DavPropDBSysLock not supported unless apr-util is
compiled with GDBM support." or something.

Actually the way things are written now, apr-util implements an external
sysvmem, fcntl or flock locking mechanism. The DavPropDBSysLock could just turn
this stuff off.


Any comments?

-RG



Russell E Glaue wrote:
> This is still a problem,
> But I think I figured out what the issue is.
> 
> apr-util-1.2.12
> apache-2.2.6
> 
> The apr-util's ./configure will always configure SDBM to compile as the 
> default
> option, and no matter that --with-db=<dbm> you choose, ./configure will always
> choose the default, SDBM, as it never recognizes your --with-db input.
> 
> So I corrected the ./configure so it will configure with gdbm.
> It still selects the default (not recognizing --with-dbm=) but I changed the
> default from SDBM to GDBM.
> 
> With these changes, apr-util compiles successfully with GDBM.
> 
> 
> Next I compile Apache 2.2, which compiles successfully with this apr-util.
> 
> I load mod_dav module successfully.
> When I PUT a file, it looks like it creates the GDBM database files 
> successfully
> (LockDB and PropsDB), but with 0 zero size.
> 
> When I perform another PUT and it attempts to access the GDBM files, I get an
> error about not being able to query the locks.
> 
> [Wed Dec 19 14:26:44 2007] [error] [client 2.1.1.1] The locks could not be
> queried for verification against a possible "If:" header.  [500, #0]
> [Wed Dec 19 14:26:44 2007] [error] [client 2.1.1.1] (11)Resource temporarily
> unavailable: Item not found  [500, #15]
> 
> 
> Then I went back and added a flag GDBM_NOLOCK to the gdbm_open function in
> dbm/apr_dbm_gdbm.c, to make GDBM never lock (flock) the GDBM files.
> 
> With these changes, apr-util compiles successfully with GDBM and the flag
> GDBM_NOLOCK.
> 
> When I start apache 2.2 and perform a PUT, I get the same error about not 
> being
> able to query the locks in the LockDB file.
> 
> 
> It looks like mod_dav/mod_dav_fs inherits the database format from apr-util.
> And with apr-util always selecting SDBM, regardless of what we choose with
> ./configure --with-db=<dbm>, as the default dbm and it works.
> When I fix this apr-util issue so it uses the dbm I choose, gdbm,
> mod_dav_fs/mod_dav doesn't work with dbm files.
> 
> I want to think that mod_dav_fs was only able to be tested to support SDBM, 
> and
> not any other format like GDBM, although I see all the gdbm libraries in the
> dav/main directory when compiling Apache 2.2.
> 
> Do I have to change something in Apache 2.2 to also get mod_dav_fs/mod_dav to
> use the gdbm database type when gdbm is the default for apr-util?
> 
> 
> Can anyone provide any information?
> 
> 
> -RG
> 
> 
> 
> Russell E Glaue wrote:
>> How would I configure/compile Apache 2.2/mod_dav to use the old dbm format 
>> for
>> property database files, as opposed to using the sdbm/gdbm/db formats?
>>
>> I already compiled and installed apr-util with --with-db=dbm, but mod_dav
>> continues to use SDBM/GDBM.
>>
>> -RG
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>    "   from the digest: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: [EMAIL PROTECTED]
>    "   from the digest: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to