[Dovecot] FreeBSD NFS file locking mechanism
Hi all,
I have some machines running FreeBSD and dovecot deployed. User's home dir is on NFS mount and I've found that dovecot only works with dotlock file locking mechanism, fcntl and flock failed. Now it causes problem with thunderbird (thunderbird is cachine connections) waiting forever and I noticed that dovecot is trying to acquire a lock but unsuccessful since the lock file is in place. Is it possible to use file locking other than dotlock on FreeBSD NFS mounted homedir? How do I achieve this?
Thanks a lot.
Tony Tsang.
On Jun 21, 2007, at 7:56 PM, Tony Tsang wrote:
I have some machines running FreeBSD and dovecot deployed. User's home dir is on NFS mount and I've found that dovecot only works with dotlock file locking mechanism, fcntl and flock failed. Now it causes problem with thunderbird (thunderbird is cachine connections) waiting forever and I noticed that dovecot is trying to acquire a lock but unsuccessful since the lock file is in place. Is it possible to use file locking other than dotlock on FreeBSD NFS mounted homedir? How do I achieve this?
I had a similar problem with NFS and dotlock contention with dovecot-
uidlist on FreeBSD 6.2. The problem is a long-standing bug in the
FreeBSD NFS client. If I remember right, when reviewing the code,
dotlock is the only option for dovecot-uidlist.
I posted a workaround patch:
http://www.dovecot.org/list/dovecot/2007-May/022883.html
Not the best solution, but it is working fine on my setup.
-Doug
Tony Tsang a écrit :
Hi all,
I have some machines running FreeBSD and dovecot deployed. User's home dir is on NFS mount and I've found that dovecot only works with dotlock file locking mechanism, fcntl and flock failed. Now it causes problem with thunderbird (thunderbird is cachine connections) waiting forever and I noticed that dovecot is trying to acquire a lock but unsuccessful since the lock file is in place. Is it possible to use file locking other than dotlock on FreeBSD NFS mounted homedir? How do I achieve this?
Thanks a lot.
Tony Tsang. We have the same setup, working with lock_method: flock
We have rpc.lockd running (rpc_lockd_enable="YES" in rc.conf) in both nfs servers and clients(dovecot server).
FreeBSD 6.2
--
___________________________________________________________
/ Geoffroy DESVERNAY |
/\ Service info
| Tel: (+33|0)4 91 05 45 24 /
\/ Ecole Centrale de Marseille | Fax: (+33|0)4 91 05 45 98 \/
\ | Mail: dgeo@ec-marseille.fr /
-----------------------------------------------------------
On Thu, 2007-06-28 at 15:18 +0200, Geoffroy Desvernay wrote:
Tony Tsang a écrit :
Hi all,
I have some machines running FreeBSD and dovecot deployed. User's home dir is on NFS mount and I've found that dovecot only works with dotlock file locking mechanism, fcntl and flock failed. Now it causes problem with thunderbird (thunderbird is cachine connections) waiting forever and I noticed that dovecot is trying to acquire a lock but unsuccessful since the lock file is in place. Is it possible to use file locking other than dotlock on FreeBSD NFS mounted homedir? How do I achieve this?
Thanks a lot.
Tony Tsang. We have the same setup, working with lock_method: flock
lock_method affects only index files. Are they also in NFS?
We have rpc.lockd running (rpc_lockd_enable="YES" in rc.conf) in both nfs servers and clients(dovecot server).
flock locks files only locally, they aren't visible to other computers. Only fcntl locks are. (Except with Linux 2.6.5+, AFAIK no other OSes do this).
Timo Sirainen a écrit :
On Thu, 2007-06-28 at 15:18 +0200, Geoffroy Desvernay wrote:
Tony Tsang a écrit :
Hi all,
I have some machines running FreeBSD and dovecot deployed. User's home dir is on NFS mount and I've found that dovecot only works with dotlock file locking mechanism, fcntl and flock failed. Now it causes problem with thunderbird (thunderbird is cachine connections) waiting forever and I noticed that dovecot is trying to acquire a lock but unsuccessful since the lock file is in place. Is it possible to use file locking other than dotlock on FreeBSD NFS mounted homedir? How do I achieve this?
Thanks a lot.
Tony Tsang. We have the same setup, working with lock_method: flock
lock_method affects only index files. Are they also in NFS?
Oups... Sorry, next time I'll read a bit more before answer...
We have rpc.lockd running (rpc_lockd_enable="YES" in rc.conf) in both nfs servers and clients(dovecot server).
flock locks files only locally, they aren't visible to other computers. Only fcntl locks are. (Except with Linux 2.6.5+, AFAIK no other OSes do this).
so I'll double-check my config...
___________________________________________________________
/ Geoffroy DESVERNAY | \
/\ `Service info` | Tel: (+33|0)4 91 05 45 24 /\
\/ Ecole Centrale de Marseille | Fax: (+33|0)4 91 05 45 98 \/
\ (ex-EGIM) | Mail: dgeo@ec-marseille.fr /
-----------------------------------------------------------
participants (4)
-
Doug Council
-
Geoffroy Desvernay
-
Timo Sirainen
-
Tony Tsang