file locking

Adrian Otto aotto at aotto.com
Mon Sep 16 20:03:41 CEST 2002


Boris,

I wrote the file-level locking code. Matthias is right. If you want locking
to work over NFS then you must use the fcntl locking. Currently the right
way to do this is to edit config.h as he suggested. If you are using a
system that does not have support for fcntl locks then the system won't lock
the files at all. Obviously, if this happens, then concurrent file access is
not safe. If you do have it, then HAVE_FCNTL will already be set to 1 after
running "configure". If it's set to 0, then you may not be able to lock
files properly over NFS. Also, make sure that you are running a correct
lockd configuration. Check your NFS documentation to find out how to do
this.

It might be better for me to make the GNU configure script smarter so that
at compile time a --with-nfs-locks argument will cause the HAVE_FLOCK and
HAVE_LOCKF to undef'ed and make HAVE_FCNTL defined if the system supports
it. I can have the configure script fail if you use this option on a system
that does not support fcntl locking for some reason. I'm putting this into
the TODO file.

Adrian

> -----Original Message-----
> From: Matthias Andree [mailto:matthias.andree at stud.uni-dortmund.de]
> Sent: Monday, September 16, 2002 10:33 AM
> To: Boris 'pi' Piwinger
> Cc: bogofilter mailing list
> Subject: Re: file locking
>
>
> Boris 'pi' Piwinger schrieb am Montag, den 16. September 2002:
>
> > How save is the file locking on the files in .bogofilter? Clearly, it
> > is possible that several bogofilter processes run at the same time.
> > They might even run on different machines (like with NFS-mounted home
> > directory).
>
> fcntl is the only scheme that will work across NFS, so you'll have to
> tune config.h on all machines to #undef HAVE_LOCKF and #undef HAVE_FLOCK
> before doing make (or issue make clean after modifying config.h). That
> way, bogofilter will use fcntl.
>
> Of course, the clients will need to have client-side locking support
> (most BSDs don't) and the NFS server must support server-side locking
> support (that's usually no problem).
>
> --
> Matthias Andree
>
> ---------------------------------------------------------------------
> FAQ: http://bogofilter.sourceforge.net/bogofilter-faq.html
> To unsubscribe, e-mail: bogofilter-unsubscribe at aotto.com
> For summay digest subscription: bogofilter-digest-subscribe at aotto.com
> For more commands, e-mail: bogofilter-help at aotto.com
>
>


For summay digest subscription: bogofilter-digest-subscribe at aotto.com



More information about the Bogofilter mailing list