Re: [Exim] Lock file

Etusivu
Poista viesti
Vastaa
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: Smith, A.D.
Kopio: exim-users
Aihe: Re: [Exim] Lock file
On Tue, 6 Mar 2001, Smith, A.D. wrote:

> Looked in the docs and found nothing (could just be me), I need to tell if a
> mail message is locked, I assumed the pressence of a "-P" file in the spool
> directory denoted a state of lockedness, but having removed this file for
> one mail it still seemed to be locked (If you're bored, could you tell me
> what the -D and -H files are, I suspect what they are, but would like
> confirmation)


<small rant>
Members of this list will testify that I'm a pretty relaxed, calm kind
of person who doesn't get worked up very often. However, lately, there
seem to have been an awful lot of postings asking questions which are
clearly answerable from the Exim manual. I this case, there is a *whole
chapter* called "Format of spool files" which will tell you what the -D
and -H files contain. It is listed in the table of contents. There is an
entry in the index for "format, spool files". Or just searching around
the specification for -D or -H will find you the information. Sheesh.

Hmm. Maybe some of these "I can't find it" questions occur because
people nowadays all use browsers and nothing else. The HTML
documentation comes in a number of pages which can't easily be searched
all at once.

May I remind everyone that the manual is provided as a single ASCII file
in doc/spec.txt. You can scan this with grep or your favourite text
editor if you can't find what you want from the TOC or the index.
</rant>

As to the original question:

. If you see a -P file, you are living in some other universe. Exim does
not use -P files.

. If you see a -J file, it probably means the file is being worked on,
but it is not a lock file. (What it is is described in the manual. Go
search.)

. Exim locks a message when it is working on it by opening the -D file
for writing, and taking out an fcntl() lock on the open file. This is
not something that is part of its user specification, and is not
documented, though there isn't any real reason why it should not be. I
don't imagine it will change.

. If you are an admin user, you can discover whether a message is locked
by a trick. Run "exim -Mt <message id>". This will attempt to thaw the
message. You will get back one of three responses:

  is locked                     message is locked
  is not frozen                 not locked, was not frozen
  is no longer frozen           not locked, was frozen


Well, strictly, you can discover whether a message was locked a very
short time ago by that method. Its status may have changed by the time
you act on the information. I would not recommend trying to do anything
to message files from outside.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.