changeset 1113:4abeb0fa0fe7 HEAD

Don't use flock() locking by default. Using both fcntl+flock doesn't work with FreeBSD.
author Timo Sirainen <tss@iki.fi>
date Sat, 08 Feb 2003 15:43:13 +0200
parents a246c1d68061
children 44b531fbb32a
files dovecot-example.conf src/lib-index/mbox/mbox-lock.c
diffstat 2 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dovecot-example.conf	Sat Feb 08 15:13:12 2003 +0200
+++ b/dovecot-example.conf	Sat Feb 08 15:43:13 2003 +0200
@@ -239,12 +239,17 @@
 # specifies that existing message are immutable.
 #maildir_check_content_changes = no
 
-# Which locking methods to use for locking mbox. All of them are used by
-# default. flock is ignored in systems which don't have it. Note that the
-# order of fcntl and flock are important to prevent deadlocks if they're both
-# also used by other programs accessing the mailbox. Dotlock file is always
-# created first.
-#mbox_locks = dotlock fcntl flock
+# Which locking methods to use for locking mbox. There's three available:
+#  dotlock: Create <mailbox>.lock file. This is the oldest and most NFS-safe
+#           solution. If you want to use /var/mail/ like directory, the users
+#           will need write access to that directory.
+#  fcntl  : Use this if possible. Works with NFS too if lockd is used.
+#  flock  : May not exist in all systems. Doesn't work with NFS.
+#
+# You can use both fcntl and flock too; if you do the order they're declared
+# with is important to avoid deadlocks if other MTAs/MUAs are using both fcntl
+# and flock. If dotlock is used, it's always created first.
+#mbox_locks = dotlock fcntl
 
 # Should we create dotlock file even when we want only a read-lock? Setting
 # this to yes hurts the performance when the mailbox is accessed simultaneously
--- a/src/lib-index/mbox/mbox-lock.c	Sat Feb 08 15:13:12 2003 +0200
+++ b/src/lib-index/mbox/mbox-lock.c	Sat Feb 08 15:43:13 2003 +0200
@@ -19,7 +19,7 @@
 #define LOCK_RANDOM_USLEEP_TIME (100000 + (unsigned int)rand() % 100000)
 
 /* lock methods to use in wanted order */
-#define DEFAULT_LOCK_METHODS "dotlock fcntl flock"
+#define DEFAULT_LOCK_METHODS "dotlock fcntl"
 /* lock timeout */
 #define DEFAULT_LOCK_TIMEOUT 300
 /* assume stale dotlock if mbox file hasn't changed for n seconds */