* Mail Locking Ultrix/OSF
@ 1994-12-30 20:05 PAUL D. CHAPIN
1994-12-30 21:59 ` Keith Moore
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: PAUL D. CHAPIN @ 1994-12-30 20:05 UTC (permalink / raw)
In the past, we've nfs shared a single filesystem containing mail
messages across mutliple Ultrix workstations. This makes it nice since
you can get your mail anywhere, and people don't have to know what
node you work on to send you mail. And it's a lot easier than having
to worry about a central mail hub.
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. The question is whether this basic strategy will work at all
across Ultrix/OSF platforms and would it make any difference if I
moved the mail filesystem from Ultrix to OSF?
Thanks, and have a happy new year.
--
Paul Chapin
User Services Coordinator
Amherst College
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
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-03 7:05 ` Mail Locking Ultrix/OSF Han Pilmeyer
2 siblings, 0 replies; 9+ messages in thread
From: Keith Moore @ 1994-12-30 21:59 UTC (permalink / raw)
In article <3e1p6l$i3f@amhux3.amherst.edu>, pdchapin@unix.amherst.edu (PAUL D. CHAPIN) writes:
> In the past, we've nfs shared a single filesystem containing mail
> messages across mutliple Ultrix workstations. This makes it nice since
> you can get your mail anywhere, and people don't have to know what
> node you work on to send you mail. And it's a lot easier than having
> to worry about a central mail hub.
>
> 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. The question is whether this basic strategy will work at all
> across Ultrix/OSF platforms and would it make any difference if I
> moved the mail filesystem from Ultrix to OSF?
As far as I can tell, NFS file locking has never worked reliably, on
any platform.
However, we have been using NFS-mounted mailboxes for several years
without too many problems. The key is to always have mail routed to
the mail server machine (which has the mailboxes on local disk) for
delivery. This can be done by tweaking sendmail config files on both
the client machines (to send all mail to the server) and the server
machine (to accept mail for all client domains for local delivery).
There are other tricks which also help, including using an automounter
on the mail server to mount people's "home directories", and a special
delivery agent that interprets a missing "home directory" as a
termporary failure condition (so if the user has a .forward file and
the file system is down, the user's mail will get queued until the
.forward file is available again.)
To eliminiate quirks of various vendor-supplied sendmails, we use
Berkeley sendmail on all of our platforms (which include several
different UNIX variants). With Berkeley sendmail, our OSF/1 clients
have worked acceptably with such a configuration. We have not tried
doing this with DEC sendmail, nor using an OSF/1 machine as a mail
server.
--
Keith Moore NETLIB development group
Computer Science Department / University of Tennessee at Knoxville
107 Ayres Hall / Knoxville TN 37996-1301
Let's stamp out drug testing in our lifetime.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
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
1995-01-03 7:05 ` Mail Locking Ultrix/OSF Han Pilmeyer
2 siblings, 1 reply; 9+ messages in thread
From: Klaus Moeller @ 1995-01-02 12:28 UTC (permalink / raw)
pdchapin@unix.amherst.edu (PAUL D. CHAPIN) writes:
>In the past, we've nfs shared a single filesystem containing mail
>messages across mutliple Ultrix workstations. This makes it nice since
>you can get your mail anywhere, and people don't have to know what
>node you work on to send you mail. And it's a lot easier than having
>to worry about a central mail hub.
>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. The question is whether this basic strategy will work at all
>across Ultrix/OSF platforms and would it make any difference if I
>moved the mail filesystem from Ultrix to OSF?
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.)
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.
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.
OSF 2.1 and up allows you to select between dotfile and fcntl based locking
(decribed in the Mail man page).
Server setup:
Local delivery for all client and the server.
Export mail spool directory to clients.
Client setup:
Mount mail spool.
Setup delivery of all mail to the server.
All:
Select ONE locking mechanism for all MUAs, MTAs and utilities like
procmail, pop/imap servers etc..
If you can: Nuke Sendmail and get Smail 3.1.29.1. Locking mechanism can be
selected at runtime (don't know if Sendmail can do this too) and config
files are easier to administer.
(Just the opinion of a smail lover)
Klaus
--
/ Klaus Moeller, Leiteweg 2, 26384 Wilhelmshaven, Germany \
< Klaus.Moeller@Informatik.Uni-Oldenburg.DE 078326@DOLUNI1.BITNET >
\ security is an exercise in applied paranoia /
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
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-03 7:05 ` Han Pilmeyer
2 siblings, 0 replies; 9+ messages in thread
From: Han Pilmeyer @ 1995-01-03 7:05 UTC (permalink / raw)
Have you tried a "rcmgr set MAILLOCKING=1" command on the DEC OSF/1 system?
--
Disclaimer: This article reflects my own opinion or guestimate, it is
not necessarily the policy of my employer.
Han Pilmeyer DEC Easynet: dcultx::pilmeyer
Digital Equipment bv Internet: han@athena.uto.dec.com
Utrecht
The Netherlands
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
1995-01-02 12:28 ` Klaus Moeller
@ 1995-01-05 15:03 ` Eric Werme
1995-01-08 5:56 ` Chuck Hedrick
0 siblings, 1 reply; 9+ messages in thread
From: Eric Werme @ 1995-01-05 15:03 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
1995-01-05 15:03 ` Eric Werme
@ 1995-01-08 5:56 ` Chuck Hedrick
1995-01-16 13:15 ` Eric Werme
0 siblings, 1 reply; 9+ messages in thread
From: Chuck Hedrick @ 1995-01-08 5:56 UTC (permalink / raw)
werme@alingo.zk3.dec.com (Eric Werme) writes:
>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.
It's almost always broken on SunOS 4.1.x (or has been enough in the
past that most of us aren't prepared to believe it's working now).
That means that in mixed environments I'm not even going to try it.
One thing I noticed in doing user support is that when something fails
a few times, people give up using it. The support staff say "why
didn't you tell us??" and they say "but everybody knows it doesn't
work". We carefully purge all code of lockf's, so you'll never get
any bug reports from us...
Rutgers has used lock files in many configurations for quite a long
time, so I'm pretty confident that it works OK. (Yes, I would notice
if it failed. Delivery to files other than your mailbox is not
similarly protected, and I see confused mail in them fairly often.) I
believe your machines need to have their time synchronized to within a
couple of seconds. The usual code ignores lock files that are over 2
minutes old. (This is in case a machine has crashed.) That won't
work if machines' time is wildly inconsistent. We're now using nntp
anyway, so that's no longer an issue. I used to use code that figured
out the difference in time between the system on which it was running
and the file server, before doing any time-based calculations.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mail Locking Ultrix/OSF
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
0 siblings, 1 reply; 9+ messages in thread
From: Eric Werme @ 1995-01-16 13:15 UTC (permalink / raw)
hedrick@geneva.rutgers.edu (Chuck Hedrick) writes:
>werme@alingo.zk3.dec.com (Eric Werme) writes:
>>At present, I believe we have three open bug reports against rpc.lockd.
>>... If NFS locking were "almost always
>>broken", I would expect more bug reports.
>It's almost always broken on SunOS 4.1.x (or has been enough in the
>past that most of us aren't prepared to believe it's working now).
One problem with SunOS is that the only path I know of to get a better
rpc.lockd is to "upgrade" to Solaris, and even then I think our lock
daemon has a couple of bug fixes Solaris doesn't.
>That means that in mixed environments I'm not even going to try it.
>One thing I noticed in doing user support is that when something fails
>a few times, people give up using it.
Yeah, I know that, and was sort of leaning on that as I said said it
works pretty well. On the other hand, we have a number of customers
who aren't familiar with the reputation rpc.lockd has (and so richly
deserved (note past tense)), and do squawk loudly when things go wrong.
Unfortunately, even the task of discovering that the problem is
related to file locking is a challenge, so I suspect some people never
bother to file a bug report because they don't know what to say.
>Rutgers has used lock files in many configurations for quite a long
>time, so I'm pretty confident that it works OK.
As far as I know, locking via "ln file file.lock" should work okay. I've
thought about it a little, and I keep that in mind whenever visiting that
part of the code. I'm not too sure about any other form. I *encourage*
people to use rpc.lockd and report problems, at least those that are *our*
problems and not SunOS's! I wish I had time to merge up my local tcpdump
with LBL's and get it back to them as it supports NLM and NFS V3 decoding,
and I wish we had a few spare months to work on rpc.lockd, but neither
get have the priority that V3, SMP performance, etc. have.
I'm a little reluctant to declare an "open season" on rpc.lockd, as the
the support people would probably hang me in effigy (if not in person), so
let me just reiterate that I think our rpc.lockd is one of the better ones
around. Of course, you all may have to "upgrade" from SunOS to OSF/1 to
benefit from it, but I'm sure everyone in this building would say that's
a fine thing to do. :-)
A couple other points:
I don't know if Sun has/will ported the Solaris rpc.lockd to SunOS. Their
transport-independent interface offers some challeneges. The current
OSF/1 rpc.lockd won't work on Ultrix, because the KLM protocol versions are
different. (The new KLM protocol has 64 bit offsets and is used for both
NFS V2 and V3.) However, we have gotten some of the new code in OSF/1's
rpc.lockd back into Ultrix, so things should be improving even there.
--
Eric (Ric) Werme | werme@zk3.dec.com
Digital Equipment Corp. | This space intentionally left blank.
^ permalink raw reply [flat|nested] 9+ messages in thread
* NFS/Mail Locking Ultrix/SunOS/OSF (was Re: Mail Locking Ultrix/OSF)
1995-01-16 13:15 ` Eric Werme
@ 1995-01-23 16:25 ` Magali BERNARD
1995-01-27 7:06 ` E-Kai Tsai
0 siblings, 1 reply; 9+ messages in thread
From: Magali BERNARD @ 1995-01-23 16:25 UTC (permalink / raw)
The problem seems to be the same for SunOS and Ultrix :
they are exporting NFS /var/spool/mail on an OSF machine and the locks
are not correctly handled (where ?)
My /var/spool/mail server is a Sun (SunOS 4.1) and there was no problem
with Decstations 3100 and 5000/20 (Ultrix 4.3). But with a DecAlpha 3000/400
(DecOSF1.3) everything goes wrong. I tried to compile sendmail 8.6.9 on both
SunOS and DecOSF1.3 but the symptoms still exist (just take a look at /etc/sm*
on each side)
I tried then on DecOSF in /etc/rc.config : NFSLOCKING 1
because the default Ultrix nfssetup is "no NFS lock" (just an idea...)
It works fine (no more lock message, /etc/sm* empty) *but* the users can't
read the mail on the DecAlpha !
kern.log says : "vmunix: fcntl: Local lock-manager not registered"
Now can we install some *local* but *notNFS* lock on DecOSF ?
--------------------------------
Magali BERNARD (magali@lirmm.fr)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: NFS/Mail Locking Ultrix/SunOS/OSF (was Re: Mail Locking Ultrix/OSF)
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
0 siblings, 0 replies; 9+ messages in thread
From: E-Kai Tsai @ 1995-01-27 7:06 UTC (permalink / raw)
: read the mail on the DecAlpha !
: kern.log says : "vmunix: fcntl: Local lock-manager not registered"
: Now can we install some *local* but *notNFS* lock on DecOSF ?
: --------------------------------
Try use "NFSSETUP" , then enable the NFS-Lock .
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~1995-01-27 7:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox