queues on NFS share
Stephane.Lentz at ANSF.ALCATEL.FR
Wed Aug 14 07:34:36 IST 2002
On Tue, Aug 13, 2002 at 01:37:04PM +0100, Julian Field wrote:
> At 12:32 13/08/2002, you wrote:
> >I want to have my mailscanner incoming and outgoing queues on an NFS
> >share. Do I need to anything special to make it work? Any help would be
> This is generally a really bad idea. I think you'll get away with doing
> this with Exim.
> You will not get away with it if you are using sendmail. The file locking
> sendmail uses doesn't work over NFS. Bad things will happen to your mail.
On the topic of locking, The Unix Programming FAQ says :
flock()' originates with BSD, and is now available in most (but not all)
Unices. It is simple and effective on a single host, but doesn't work
at all with NFS. It locks an entire file. Perhaps rather deceptively, the
popular Perl programming language implements its own `flock()' where
necessary, conveying the illusion of true portability.
`fcntl()' is the only POSIX-compliant locking mechanism, and is
therefore the only truly portable lock. It is also the most powerful, and the
hardest to use. For NFS-mounted file systems, `fcntl()' requests are
passed to a daemon (`rpc.lockd'), which communicates with the lockd on
the server host. Unlike `flock()' it is capable of record-level locking
On linux.kernel I noticed a post :
flock(2) does not lock files over NFS. Use fcntl(2)
instead: that does work over NFS, given a sufficiently
recent version of Linux and a server which supports lock
flock(2) and fcntl(2) locks have different semantics with
respect to forked processes and dup(2).
NFS sharing a queue sounds like headache & problems .....
Stephane Lentz / Alcanet International - Internet Services
More information about the MailScanner