[comp.sys.apollo] Elm on HP-Apollo Domain's : Problem!

ashley@usage.csd.oz (Ashley Aitken) (10/24/90)

G'day.

Elm is a wonderful mailer and I don't know how I would live without it!
Thanks to all those that develop, maintain, test and distribute it!

However, there seems to be some difficulty with using Elm on HP-Apollo Domain's.In particular, the Apollo machines seem to not allow appending to a file which
is being read (ie opened in read, or read-write? mode) by someone else. Hence,
if I am reading mail and someone mails me, the mail bounces with an error like
this:
	Returned mail: unknown mailer error 1
	... Transcript ...
	mail: /usr/spool/mail/ashley: cannot append
	Mail saved in dead.letter
	554 ashley... unknown mailer error 1

This is causing understandable distress to the System Supervisor who constantly
needs to forward the dead mail to me. It seems mostly to occur when I am using
Elm, but sometimes even when I am not - perhaps there are some fragments of a 
hung Elm session lying around or it left the file open?

I compiled Elm for these machines myself (without complete confidence that I
got it right, but other than this problem it seems to work almost better than
perfectly).

Any suggestions on how I can save Elm from being purged would be gratefully
accepted. I am sure there are other Apollo sites out there using Elm.

Thanx in Advance,
Ashley Aitken.

--
E-MAIL  ashley@spectrum.cs.unsw.oz.au				   AARNet
	ashley%spectrum.cs.unsw.oz@uunet.uu.net			   Internet
	{uunet,ukc,ubc-vision}!munnari!spectrum.cs.unsw.oz!ashley  UUCP	

POSTAL	Academic Address:			Residential Address:
	School of EE and CS, (Rm 345)		c/o Basser College, (Rm 123-4)
	University of New South Wales,		The Kensington Colleges,
	Box 1,PO KENSINGTON,N.S.W.,2033,	Box 24,PO KENSINGTON,3033.
	AUSTRALIA.				AUSTRALIA.
	Ph. (02) 697-4419 Fx. (02) 662-2087	Ph. Aust (02) 663-8117

rees@pisa.ifs.umich.edu (Jim Rees) (10/25/90)

In article <692@spinifex.eecs.unsw.oz>, ashley@usage.csd.oz (Ashley Aitken) writes:
  Any suggestions on how I can save Elm from being purged would be gratefully
  accepted. I am sure there are other Apollo sites out there using Elm.

Here is the correct way (or at least, a correct way) for mailers to handle
user's mail spool files (/usr/spool/mail/joe_user):

Try to open the file for exclusive use (read or write, as needed).
If it's locked, sleep for a few seconds and loop as needed.
If you can't get it after half a minute or so, return an error.
When you get the file open, read or write it, then close it.
Don't leave it open while the user is sitting there reading his mail,
  for example.

This will ensure that everyone gets exclusive use of the file.  I happen to
like Apollo's implicit file locks.  They make it easier to write distributed
applications and operating systems.  Unfortunately, the rest of the Unix
universe seems to either ignore the problem or use explicit locks, which I
find harder to think about and harder to use.

You can do all this with ios_$ call, and I think you can do it with regular
Unix calls now, too.  For some sample code, see the Apollo B news patches,
file apollo.c.

The stupid thing is that the mail programs that come with your Apollo don't
conform to the Apollo file locking rules.