Re: Emacs20 and mail file locking.

1998-01-10 Thread Rob Browning
[EMAIL PROTECTED] (Karl M. Hegbloom) writes:

>  I think that it is probably fine like it is, except that it's not nfs
> safe without libnfslock.  It could probably be rewritten some to call
> on our liblockfile, rather than doing it internally the way it does.

Does xemacs implement maillock itself?  Emacs 20 doesn't, so emacs
20's maillock *would* be using liblockfile and so should be nfs safe.

The only problem that I've seen with emacs 20's movemail support of
maillock() (though I still don't feel qualified to be certain) is that
it appears to call maillock("full/path/to/spool", foo) rather than
maillock("username", foo).

Have you heard from James LewisMoss recently?  I posted a propsal for
some immediate changes to the various emacsen which would move us
closer to supporting simultaneous install.  I think Mark's OK with it,
but James hasn't said anything, and neither has anyone else...

My fear is everyone will only start screaming *after* I implement and
upload something :<

>  If it ain't broke, don't fix it.  I'm not motivated to do this
> today... It works like it is, for me.  Someone who needs the nfs safe
> version ought to tackle it.  I don't imagine it will take more than an
> afternoon of hacking.

Well, I think we really need to get everything nfs safe -- silent
failures suck, and loss of mail sucks even more.

>  I wonder, would it be a good idea to put `movemail' into another
> general package, so that other programs can use it?  I think that it's
> generally useful enough for that.

It might make sense to put movemail in emacsen-common.  But that's
only good idea if xemacs, emacs19, and emacs20 expect the identical
semantics out of movemail...

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1998-01-09 Thread Karl M. Hegbloom
> "Rob" == Rob Browning <[EMAIL PROTECTED]> writes:

Rob> Maybe you already knew this, but I just got around to looking
Rob> at the movemail source for emacs 20, and it really looks like
Rob> movemail already knows how to handle liblockfile.  Check out
Rob> MAIL_USE_MAILLOCK and HAVE_TOUCHLOCK.

 I think that it is probably fine like it is, except that it's not nfs
safe without libnfslock.  It could probably be rewritten some to call
on our liblockfile, rather than doing it internally the way it does.

 If it ain't broke, don't fix it.  I'm not motivated to do this
today... It works like it is, for me.  Someone who needs the nfs safe
version ought to tackle it.  I don't imagine it will take more than an
afternoon of hacking.

 The XEmacs version, as shipped with XEmacs-20.5-beta, has some
changes.  The diff is attached, to save anyone the trouble of
generating one themselves.  A quick look over tells me that there's
probably no need to use this patch anyway...

 I wonder, would it be a good idea to put `movemail' into another
general package, so that other programs can use it?  I think that it's
generally useful enough for that.



movemail-emacs-20.2-xemacs-20.5.diff.gz
Description: Binary data



Re: Emacs20 and mail file locking.

1998-01-07 Thread Rob Browning
[EMAIL PROTECTED] (Karl M. Hegbloom) writes:

> > "Rob" == Rob Browning <[EMAIL PROTECTED]> writes:
> 
> Rob> Assuming you're right, and movemail is used for all mail
> Rob> locking, then if we patch movemail to use liblockfile, we
> Rob> should be fine.
> 
>  I volunteer to try rolling those patches into XEmacs 20.5.  I think
>  that configure ought to detect `liblockfile' and compile `movemail'
>  accordingly.  Sound right?

Maybe you already knew this, but I just got around to looking at the
movemail source for emacs 20, and it really looks like movemail
already knows how to handle liblockfile.  Check out MAIL_USE_MAILLOCK
and HAVE_TOUCHLOCK.

If someone who knows liblockfile better than I do gets motivated
before I do, please check movemail to make sure it really is doing the
right thing when those vars are defined, and let me know.

Thanks

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-31 Thread Rob Browning
[EMAIL PROTECTED] (Karl M. Hegbloom) writes:

>  I volunteer to try rolling those patches into XEmacs 20.5.  I think
>  that configure ought to detect `liblockfile' and compile `movemail'
>  accordingly.  Sound right?

Sounds good, but perhaps it should just fail to build on a debian
system if liblockfile-dev's not installed.  Otherwise, without source
dependencies, it would be easy for a non-maintainer release (if there
ever is one) to be built broken, such that mail could be lost.  Given
this possibility, messing with configure might be overkill.  Just hard
code the -llockfile, and be done with it.

I guess you could go so far as to have a configure option that forces
the use of liblockfile, and then put that in the rules file, but that
may be more trouble than it's worth.

In any case, let me know how it goes.  I'd like to be able to steal
your work for incorporation into the emacs 20 package, if possible.

> Rob> I'm under the impression that liblockfile handles everything,
> Rob> including nfs.  I believe libnfslock is transitional, for use
> Rob> until everything's migrated to liblockfile.
> 
>  Yes, that seems right... I looked them over once a few months ago.  I
>  think after I've finished reading the two W. Richard Stevens Unix
>  programming books I've just begun, I will go over them again with
>  better understanding, and thus, better recollection.

I don't think you even need to go that far; if the man page is to be
believed, NFS is handled by liblockfile:

DESCRIPTION
   The maillock function tries to create a lockfile  for  the
   users  mailbox.  This  mailbox  is  typically  located  in
   /var/spool/mail.  The name of the  lockfile  then  becomes
   /var/spool/mail/username.lock.   Maillock uses an NFS safe
   algorithm that is documented in lockfile_create(3).

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-28 Thread Karl M. Hegbloom
> "Rob" == Rob Browning <[EMAIL PROTECTED]> writes:

Rob> Assuming you're right, and movemail is used for all mail
Rob> locking, then if we patch movemail to use liblockfile, we
Rob> should be fine.

 I volunteer to try rolling those patches into XEmacs 20.5.  I think
 that configure ought to detect `liblockfile' and compile `movemail'
 accordingly.  Sound right?

Rob> I'm under the impression that liblockfile handles everything,
Rob> including nfs.  I believe libnfslock is transitional, for use
Rob> until everything's migrated to liblockfile.

 Yes, that seems right... I looked them over once a few months ago.  I
 think after I've finished reading the two W. Richard Stevens Unix
 programming books I've just begun, I will go over them again with
 better understanding, and thus, better recollection.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-28 Thread Rob Browning
[EMAIL PROTECTED] (Karl M. Hegbloom) writes:

>  I don't think that the dot locking done by `movemail' is nfs-aware.
>  You'd need to use libnfslock for that, I guess, or patch `movemail'.

Assuming you're right, and movemail is used for all mail locking, then
if we patch movemail to use liblockfile, we should be fine.

I'm under the impression that liblockfile handles everything,
including nfs.  I believe libnfslock is transitional, for use until
everything's migrated to liblockfile.

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-25 Thread Karl M. Hegbloom
 ... more to say, now that I read what I wrote...

 I don't think that the dot locking done by `movemail' is nfs-aware.
 You'd need to use libnfslock for that, I guess, or patch `movemail'.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-25 Thread Karl M. Hegbloom
> "Rob" == Rob Browning <[EMAIL PROTECTED]> writes:

Rob> OK, then I'll assume that we want to hack emacs to use
Rob> liblockfile.  This requires repeatedly calling touchlock() to
Rob> keep the lockfile from being deleted during the period when
Rob> the lock is being held.  I think this may be a problem if
Rob> emacs grabs the lock (with maillock()), and then the user
Rob> suspends the program for more than 5 minutes (the default
Rob> timeout for maillock).  When emacs resumes, the lockfile has
Rob> been deleted, but emacs still thinks it has the lock.

 Please see the functions I wrote for working with `smartlist'
 run-control files, at:

  http://inetarena.com/~karlheg/Public/site-lisp/led-funcs.el

 ... That's tested in XEmacs; it shouldn't be too hard to port to GNU
 Emacs.

 If you hack XEmacs to use liblockfile, will you please conditionalize
 it somehow and submit the patches to the xemacs-beta team?

Rob> The only simple way I can see around this problem is to have
Rob> emacs spawn a small process to keep touching the lockfile
Rob> (every 4 minutes or so) whenever it acquires the lock, and
Rob> kill that process when the lock is released.  Does that seen
Rob> reasonable to everyone else?

 That's essentially what my code does, using `itimer', `call-process'
 and the `touch' program.

 I don't think that Emacs ever locks a mail spool file itself.
 `movemail' does that, and it already does dot-locking...  Well, I
 know that the XEmacs version does.  I assume that the GNU Emacs one
 does as well.  If not, there's probably no reason why you can't use
 the XEmacs version of `movemail' with both emacsen.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-25 Thread Rob Browning
David Frey <[EMAIL PROTECTED]> writes:

> It isn't. The old policy mandated dot-lock, IIRC.

OK, then I'll assume that we want to hack emacs to use liblockfile.
This requires repeatedly calling touchlock() to keep the lockfile from
being deleted during the period when the lock is being held.  I think
this may be a problem if emacs grabs the lock (with maillock()), and
then the user suspends the program for more than 5 minutes (the
default timeout for maillock).  When emacs resumes, the lockfile has
been deleted, but emacs still thinks it has the lock.

The only simple way I can see around this problem is to have emacs
spawn a small process to keep touching the lockfile (every 4 minutes
or so) whenever it acquires the lock, and kill that process when the
lock is released.  Does that seen reasonable to everyone else?

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-21 Thread Christian Schwarz
On 18 Dec 1997, Rob Browning wrote:

> My question is, should I modify emacs to use maillock from liblockdev,
> or it the emacs mechanism OK (what about NFS)?

Note, that the policy requires you to use "libfilelock" (not "liblockdev"
which is just for devices) to lock mail folders--or implement a compatible
mechanism.


Chris

--  _,, Christian Schwarz
   / o \__   [EMAIL PROTECTED], [EMAIL PROTECTED],
   !   ___;   [EMAIL PROTECTED], [EMAIL PROTECTED]
   \  /
  \\\__/  !PGP-fp: 8F 61 EB 6D CF 23 CA D7  34 05 14 5C C8 DC 22 BA
   \  / http://fatman.mathematik.tu-muenchen.de/~schwarz/
-.-.,---,-,-..---,-,-.,.-.-
  "DIE ENTE BLEIBT DRAUSSEN!"


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-20 Thread David Frey
On Thu, Dec 18 1997 12:16 CST Rob Browning writes:
>   /* On GNU/Linux systems, both methods are used by various mail
>  programs.  I assume that most people are using newer mailers that
>  have heard of flock.  Change this if you need to. */
> 
>   #define MAIL_USE_FLOCK
> 
> And here's the relevant bit from debian-policy:
> 
>  All Debian MUAs and MTAs have to use the `maillock' and `mailunlock'
>  functions provided by the `liblockfile' packages to lock and unlock
>  mail boxes. These functions implement a NFS-safe locking mechanism.
>  (It is ok if MUAs and MTAs don't link against liblockfile but use a
>  *compatible* mechanism. Please compare the mechanisms very carefully
!)
> 
> If emacs' current mechanism *is* compatible, then I could save some
> hassle.
It isn't. The old policy mandated dot-lock, IIRC.

David



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-19 Thread Rob Browning
[EMAIL PROTECTED] (Mark W. Eichin) writes:

> I'll note that emacs19 does what was right at one point, *before*
> liblockfile was written; I don't know if they're compatible but figure
> that before debian 2.0 it would be safest to code up a fix.  (Or steal
> your code from emacs20 :-)

My suspicion is that the way it's done now in emacs 19 will still work
as well as it did before, which is probably fine for everything but
NFS.  Using maillock would fix the problem completely, but will
probably require some code weaselry.

Unfortunately, the policy says to check the implementation in maillock
to see if you're compatible, and the manpage for maillock says to see
lockfile_create(3), which doesn't exist.  I'll have to UTLSL, but I
may release an initial package before doing all that.  Things won't be
any worse than they are now, and then then I can see about fixing
both emacsen.

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Re: Emacs20 and mail file locking.

1997-12-19 Thread Mark W. Eichin
I'll note that emacs19 does what was right at one point, *before*
liblockfile was written; I don't know if they're compatible but figure
that before debian 2.0 it would be safest to code up a fix.  (Or steal
your code from emacs20 :-)


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .



Emacs20 and mail file locking.

1997-12-18 Thread Rob Browning

My question is, should I modify emacs to use maillock from liblockdev,
or it the emacs mechanism OK (what about NFS)?

My reading is that emacs needs to be modified, but since liblockdev
requires you to call touchlock on a regular basis, I'm worried that
the modification might be non-trivial.

Here's the relevant bit from the Emacs config:

  /* define MAIL_USE_FLOCK if the mailer uses flock
 to interlock access to /usr/spool/mail/$USER.
 The alternative is that a lock file named
 /usr/spool/mail/$USER.lock.  */

  /* On GNU/Linux systems, both methods are used by various mail
 programs.  I assume that most people are using newer mailers that
 have heard of flock.  Change this if you need to. */

  #define MAIL_USE_FLOCK

And here's the relevant bit from debian-policy:

 All Debian MUAs and MTAs have to use the `maillock' and `mailunlock'
 functions provided by the `liblockfile' packages to lock and unlock
 mail boxes. These functions implement a NFS-safe locking mechanism.
 (It is ok if MUAs and MTAs don't link against liblockfile but use a
 *compatible* mechanism. Please compare the mechanisms very carefully!)

If emacs' current mechanism *is* compatible, then I could save some
hassle.

Thanks

-- 
Rob Browning <[EMAIL PROTECTED]>
PGP fingerprint = E8 0E 0D 04 F5 21 A0 94  53 2B 97 F5 D6 4E 39 30


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .