From: werme@alingo.zk3.dec.com (Eric Werme)
Subject: Re: Mail Locking Ultrix/OSF
Date: 5 Jan 95 15:03:43 GMT [thread overview]
Message-ID: <werme.789318223@alingo.zk3.dec.com> (raw)
In-Reply-To: 1995Jan2.124404.1101@arbi.Informatik.Uni-Oldenburg.DE
Klaus.Moeller@arbi.informatik.uni-oldenburg.de (Klaus Moeller) writes:
>pdchapin@unix.amherst.edu (PAUL D. CHAPIN) writes:
>>The problem is that we're adding OSF/1 workstations, and they aren't
>>being very cooperative. It's no problem to mount the mail filesystem
>>and read messages from it, but it you try to mail anything to it you
>>get various kinds of locking problems. I can find very little doc on
>>file locking with mail under Ultrix. I'm beginning to suspect that
>>this was tightened up on OSF to get rid of some mail related security
>>problems.
No, I believe that was tightened up to close races where you can lose
mail arriving at the same time as the NFS client is truncating the mail
file. The solution is for all parties to lock the file, and that's what
OSF/1 is doing. I'm not sure what the mail code on Ultrix is doing, but
at the very least you should be running rpc.lockd on the server.
>There are three ways to lock a file under UNIX
>1) Dotfile based locking. I.e. to lock a file <filename> create a file
> <filename>.lock. Not totally secure (you might get race conditions),
> locks only a complete file but it works on almost everything, even NFS
> and *ancient* versions of UNIX. Be sure that the process id is *not*
> written to the lock file. (Process id is a method to detect stale locks
> but does not work on a network, for example if the writing process is
> on a different machine than the stale-lock-checking-process.)
For a long time, this was the only locking mechanism available on Unix. I
haven't thought through the various race possibilities when this is done
over NFS. One drawback of this is that locks persist over system crashes
and power failures.
>2) flock or fcntl based locking. Advisory locking mechanism that allows
> locking of a part of a file. DOES NOT WORK OVER NFS.
>3) lockf based locking. Works over NFS. Operation similiar to that of fcntl.
You are confused. flock(2) is a whole file locking mechanism that is not
effective over NFS.
lockf(3) is a libc routine that translates into fcntl(2) system calls. If
the file is a NFS client file, this works only if the clicnt and server are
running rpc.lockd.
> Should be the locking mechanism of choice if it weren't almost allways
> broken. I recomend not to use it, since you can't even expect lockd to
> work over different releases of the same OS.
At present, I believe we have three open bug reports against rpc.lockd. One
affect PCs and some third party NFS implementations. One old report
involves mishandling a lost NLM message between lock daemons and was found
in local testing, and one recent report involves simultaneously taking out
hundreds of locks, but that may have been fixed in V3.0. That fix is in a
patch available from Ultrix support. If NFS locking were "almost allways
broken", I would expect more bug reports.
While rpc.lockd and automount have justly deserved their reputations, the
OSF/1 rpc.lockd is not too bad. It could certainly use a few months of
work, but it is a lot better lock daemons of a few years ago. (And automount
here is far more solid than what we got from Sun.) One challenge they both
labor under is that a huge amount of code has to be working for both to
work well.
As for NFS locking mail files, I'm no mail guru, so I'm not certain what
you want to do with a OSF/1 client and Ultrix server. Running lock daemons
on both is the first step.
--
Eric (Ric) Werme | werme@zk3.dec.com
Digital Equipment Corp. | This space intentionally left blank.
next prev parent reply other threads:[~1995-01-05 15:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1994-12-30 20:05 Mail Locking Ultrix/OSF PAUL D. CHAPIN
1994-12-30 21:59 ` Keith Moore
1995-01-02 12:28 ` Klaus Moeller
1995-01-05 15:03 ` Eric Werme [this message]
1995-01-08 5:56 ` Chuck Hedrick
1995-01-16 13:15 ` Eric Werme
1995-01-23 16:25 ` NFS/Mail Locking Ultrix/SunOS/OSF (was Re: Mail Locking Ultrix/OSF) Magali BERNARD
1995-01-27 7:06 ` E-Kai Tsai
1995-01-03 7:05 ` Mail Locking Ultrix/OSF Han Pilmeyer
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox