where do uucp LTMP files come from?

John Jorgensen jorgnsn at qucis.queensu.CA
Wed Feb 22 02:54:02 AEST 1989


I have a short question, and a long explanation for why the
question is of interest.  

We have a diskless Sun 3/160 running Sun Unix 3.5 that acts as
our uucp gateway to the world.  The uucp spool directory is on an
NFS-mounted file system.

The simple question is, how do empty LTMP.<pid> files get
abandoned in the uucp spool directory?  We average about four or
five of these abandoned files a day.  LTMP files are one of the
things cleaned up by the daily uucp maintenance script
distributed by Sun, so someone must expect them to appear.  I'd
like to know what particular circumstances cause them.

I glanced at some old (3.0) source, and it looks like LTMP files
are created by a routine called onelock() as part of the process
of creating a lock file.  First the locking process tries to
create the file LTMP.<mypid>.  If it succeeds, it tries to link
the name of the lockfile it is creating to the LTMP file.
Whether or not this link succeeds, the LTMP file is unlinked.
The only way that onelock() exits without unlinking LTMP is if
the initial creation of LTMP fails, which presumably means
there's no LTMP to unlink.  In other words, I can't see how the
LTMP files ever live longer than a few fractions of a second.

This would only be of academic interest if it were not for the
fact that many, but not all, of these leftover LTMPs are
associated with lines in the ERRLOG file that read like:

    ASSERT ERROR (uux)  pid: 29603 (2/16-13:25) CAN  NOT GET LCK.SEQL (0)

and all of these lines are associated with failed attempts to
send uucp mail by uux'ing rmail.  The mail daemon sends the
postmaster a message like:

    uux failed. code -1
    554 hostname!userid ... unknown mailer error 255

I have a wildly speculative hypothesis for explaining these
failures:  Uux locks the sequence number file to create the first
work file, but for some reason, the LTMP file used in the process
of creating the LCK.SEQL lock file doesn't disappear.  As a
result, when Uux tries to lock the sequence number again to
create another work file, it fails, and puts the message into
ERRLOG.  Even if this story is true, though, it comes back to the
question, why isn't the LTMP file deleted (and why is it empty?
onelockf() should write its process number into the LTMP file as
soon as it's created).

Someone here suggested that perhaps the fact that LTMP has been
deleted might not propogate through NFS's caches quickly enough,
so that it sometimes appears to the second locking attempt that
the file is still there.  Is this conceivable?

I'm hoping there are some uucp wizards out there who can answer
this with ``But it's obvious that...''.  You can mail responses
if this question is not of sufficiently general interest for
posted replies.

John Jorgensen
jorgnsn at qucis.queensu.ca



More information about the Comp.unix.questions mailing list